The class object adds an mouse event listener, that object is added to the stage five times and waits to get clicked
custom_class.zip
//The number after the asterisk is the range from which the random number will come
//A random number between 1 and 100, since i’m using an int there will be no .whatever
var randomNumber:int = Math.random()*100;
trace(randomNumber);
/// with a range and I’m told with a better value distribution
var lowVal:int = 100;
var highVal:int = 201;
var randomNumber:int = ( Math.random() * (1+highVal-lowVal) ) + lowVal;
trace(randomNumber);
// import the class
import fl.data.DataProvider;
// create and load some data into the comboBox
// this one is already on the stage but you can also var myCBox:ComboBox = new ComboBox(); etc.
var dp:DataProvider = new DataProvider();
var sortFilters:Array = [ ["value 1", "Label 1"], ["value 2", "Label 2"], ["value 3", "Label 3"], ["value 4", "Label 4"],];
for (var i:uint=0; i < sortFilters.length; i++) {
dp.addItem( { label: sortFilters[i][1], data:sortFilters[i][0] } );
}
myCBox.dataProvider = dp;
// add the listener
myCBox.addEventListener(Event.CHANGE, changeHandler);
function changeHandler(event:Event):void {
whateverYouWantToHappen();
}
When I tried to log in I got this:
ERROR
PTY allocation request failed on channel 0
The only way I could get in was to log in like this:
ssh myusername@myhost “/bin/bash -i”;
After a bit of Googling this was the fix I found that there is a device ptmx that might be missing with this error message. SO:
# /sbin/MAKEDEV -d /dev ptmx
restart ssh
/etc/init.d/sshd restart (reload would work to I would think)
Be warned…. this is probably dangerous, and will probably destroy your computer and kick your dog. You probably shouldn’t do this, but if you want to here is how:
Edit the /etc/auto_master file. You’ll need admin privileges to do this like so: sudo vi /etc/auto_master. All you need to do is comment out the line that starts /home by putting a pound sign (#) in front of it. When you are done, here’s how the file should look:
#
# Automounter master map
#
+auto_master # Use directory service
/net -hosts -nobrowse,nosuid
#/home auto_home -nobrowse
/Network/Servers -fstab
/- -static
Once you do this, you need to restart your machine.
After googling and trying every solution in excruciating detail none worked. I’m completely convinced the error was related to rebuilding the app with the same name. The first version was already provisioned and running without problem on my phone, if this isn’t your problem then this won’t work for you. But if it is then try it, it worked for me.
Take your .xcodeproj, .pch, main.m, class and .xib files (note not the build directory, not that I’m sure that matters) and dump them in the directory of the provisioned app, Build > Clean All Targets and poof…. it worked.
Here are some of the urls that I tried:
http://vehera.jsn-server7.com/jana/blog/?p=141
http://blog.besiex.com/?p=45
http://iphoneincubator.com/blog/general/your-mobile-device-has-encountered-an-unexpected-error-0xe800003a
http://discussions.apple.com/thread.jspa?threadID=1833723&tstart=0
http://www.24100.net/2009/02/iphone-sdk-mobile-provisioning-0xe800003a-0xe8000001/
.h file
// sensitivity level, 1.0 was way too sensitive 1.1 not enough
#define kAccelerationThreshold 1.07
#define kUpdateInterval (1.0f/10.0f)
@interface MainViewController : UIViewController <UIAccelerometerDelegate> {
.m file
- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration {
if (fabsf(acceleration.x) > kAccelerationThreshold ||
fabsf(acceleration.y) > kAccelerationThreshold ||
fabsf(acceleration.z) > kAccelerationThreshold ) {
// whatever needs to happen here in this case select a sound and then play it
[self playSound: [self getSelectedSound] ];
}
}
this went in the - (void)viewDidLoad {
UIAccelerometer *accel = [UIAccelerometer sharedAccelerometer];
accel.delegate = self;
accel.updateInterval = kUpdateInterval;
Here it is:
NSString* urlString = [NSString stringWithFormat:@"http://www.tldomain.com/"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]];
#include
int generated = arc4random() % 10;
generated will be an integer between 0 and 10.
or
#import
#import
srandom(time(NULL));
int generated = random() % 10;
Video codecs such as On2 VP6 and Sorenson Spark perform better when the frame width and height use multiples of 16. While you can use any width and height in your encoding settings, non-optimal dimensions can result in poor image quality and reduced frame rate. For the best image quality and playback, you should always use width and height dimensions that use a multiple of 4 (good), 8 (better), or 16 (best). Refer to the following tables to pick dimensions for your layout.
NOTE: Both the native encoding dimensions and the playback dimensions should be a multiple of 16. For example, if you encode your FLV file to use a frame dimension of 320×240, you should scale to a size such as 512×384.
Table 1 - 4:3 Aspect Ratio Sizes
Best (16)
Better (8)
Good (4)
640 x 480
608 x 456
624 x 468
576 x 432
544 x 408
592 x 444
512 x 384
480 x 360
560 x 420
448 x 336
416 x 312
528 x 396
384 x 288
352 x 264
496 x 372
320 x 240
288 x 216
464 x 348
256 x 192
224 x 168
432 x 324
192 x 144
160 x 120
400 x 300
128 x 96
368 x 276
336 x 252
304 x 228
272 x 204
240 x 180
208 x 156
176 x 132
144 x 108
112 x 84
Table 2 - 16:9 Aspect Ratio Sizes
Best (16)
Better (8)
Good (4)
1280 x 720
1152 x 648
1216 x 684
1024 x 576
896 x 504
1088 x 612
768 x 432
640 x 360
960 x 540
512 x 288
384 x 216
832 x 468
256 x 144
128 x 72
704 x 396
576 x 324
448 x 252
320 x 180
192 x 108