Does what it says on the label, Adobe has introduced h.264 codec inside Flash Player 9 Update 3 (v 9.0.115.0) this script detects if you have below that version installed/or flsh player 10 in that case wont matter (i hope, haha).
//Flash player h.264 detection script// //Flash Player 9 Update 3 (v 9.0.115.0)//
//results trace('flash player settings\n --- \nfpv full version = '+fpv+'\nfpv current = '+fpvCurrent+'\nfpv build = '+fpvBuild+' \n\n'); res.text += 'flash player settings\n --- \nfpv full version = '+fpv+'\nfpv current = '+fpvCurrent+'\nfpv build = '+fpvBuild+' \n\n';
function fpvXcheck(){ res.text += 'run detection\n --- \n'; trace('run detection\n---'); //fpvX version check? fpvX = 10; // if (fpvCurrent>=fpvX) { trace('flash player('+fpvX+') detected h.264 supported.'); res.text += 'flash player('+fpvX+') detected h.264 supported.'; } else { trace('flash playerX not installed, run flash9 check?'); res.text += 'flash playerX not installed, run flash9 check?'; checkCurrent(); } } fpvXcheck();
function checkCurrent() { //checkCurrent if (fpvCurrent == "9") { trace('\nfpv current('+fpvCurrent+') = installed'); res.text += '\nfpv current('+fpvCurrent+') = installed'; checkBuild(); } else { trace('\nfpv current('+fpvCurrent+') = incorrect, please update flash player v(9.0.115.0) or higher. \n'); res.text += '\nfpv current('+fpvCurrent+') = incorrect, please update flash player v(9.0.115.0) or higher. \n'; } }
function checkBuild() { //checkBuild if (fpvBuild>=115) { trace('\nfpv build('+fpvBuild+') = correct \n\n*successful! flash player supports h.264'); res.text += '\nfpv build('+fpvBuild+') = correct \n\n*successful! flash player supports h.264'; } else { trace('\nfpv build('+fpvBuild+') = incorrect version, please update flash player v(9.0.115.0) or higher. \n\n*sorry! flash player doesnt support h.264'); res.text += '\nfpv build('+fpvBuild+') = incorrect version, please update flash player v(9.0.115.0) or higher. \n\n*sorry! flash player doesnt support h.264'; } }
Here are a few different ways of implementing a button within flash using as code/button. basically all you need to do is drop or create a button on your main timeline. Then see the code sniplet examples below:
//as code //AS1 version, click onto the button then add code onto it. on(release){ trace("as1Btn - clicked"); } //This will work with AS1, but will need to add an instance name to the button. as1Btn.onRelease = function(){ trace("as2Btn - clicked"); }
//AS2 version, add your button to the stage then give your button an instance name 'as2Btn' then add this sniplet anywhere on your main timeline. as2Btn.onRelease = function():Void { trace("as2Btn - clicked"); }
//AS3 version, same as above basically. as3Btn.addEventListener(MouseEvent.MOUSE_DOWN,pressBtn); function pressBtn(event:MouseEvent){ trace("as3Btn - clicked"); }
//value//vertical//horizontal "T" top center "B" bottom center "L" center left "R" center right "TL" top left "TR" top right "BL" bottom left "BR" bottom right
I have written a code snippet below to handle the resize of flash/browser window to scale arrordingly to the stage.
set your flash embed tags within your HTML page to '100%' width/height.
path: Shared objects are stored locally on the users machine here is the path: C:\Documents and Settings\[login name]\Application Data\Macromedia\Flash Player\#SharedObjects\ (within the '#SharedObjects' file browse for a folder 'localhost' for local testing if testing remotely locate URL name i.e. 'servername.com' etc. within that file there will be a file labeled 'fileX.sol').
size: shared objects can only store 100KB from each URL thereafter it overwrites it.
extension: .SOL = Local Shared Object (stands for).
Haven’t posted anything in a while been so busy with life ATM which is finally looking good right now for once …
Was making a top friends image scroller for Myspace really hate having to number my friends so I decided to make a scroller instead might even make it load in the images/friends randomly.
//image scroller [v1.0]
Make a MC (MovieClip) on your flash stage, then select it and open up the actions panel (F9) add this bit of AS (ActionScript).
onClipEvent(enterFrame){ _x = _x+2; //moves the MC two pixels if (_x>=420){ //if MC reaches 420px goes back to original position _x = -360; } }
This is a randomizer script once the function has been called it randomly selects a value between 1-3 then runs an if statement to detect which variable has been generated then calls the action in this case outputs it into a trace command.
Thought this might come in handy for a few out there its a wait interval all you need to do is copy and paste this code sniplit into your timeline to get to work.
check the trace commands in the output panel for examples,
code definitions:
when the handle has been called 'waitXcall', sets a timer of 4 seconds '4*1000' then calls the interval waitX which then clears of the timer has depleted displaying the trace/goto frame.
----- code starts -----
//waitX trace('waitX here \nWaitX by 1NF3C710N.'); waitX = function(){ clearInterval(waitXcall); trace('waitX complete, gogogo'); //_root.play(); } waitXcall = setInterval(waitX, 4*1000); //set the viable 4 higher value to wait longer. // stop();
Wrote this at work had a crazy project that required detection of a exact sequence so i made this array check0r (hope this helps someone).
//arrayX //var arrayX = new Array("0","1","2","3","4","5"); var arrayX =[]; trace(arrayX) trace('arrayX: '+arrayX) for (var i=0;i[arrayX.length;i++){ trace (arrayX.join()); } //arrayXadd function arrayXaddit(){ arrayXadd = arrayX[0]+","+arrayX[1]+","+arrayX[2]+","+arrayX[3]+","+arrayX[4]+","+arrayX[5]; trace('arrayXadd: '+arrayXadd); } //arrayXcheck function arrayXcheck(){ arrayXaddit(); if(arrayXadd == '0,1,2,3,4,5'){ trace('w000t'); trace(arrayX) }else{ trace('b0000'); trace('arrayX: '+arrayX) trace('arrayXadd: '+arrayXadd) }
} //
//this add a new var to the arrays string and does a handy trace back. on(release){ arrayX.push(+1); trace('arrayX: '+arrayX); }
//this calls the function 'arrayXcheck' check if array matches. on(release){ //var arrayX = new Array("0","1","2","3","4","5"); trace(arrayX); arrayXcheck(); }
sorry if its abit brief will add more info later. enjoy
well i'm a graphic/flash designer/developer, i play to much MMORPG/FPS ;o love listening to orchestral style black/death metal. all that are from the electronic world i am the 1NF3C710N.