Often, when projects become bigger and more complicated, it often is necessary gto let the application behave different when exported within the IDE and the actual LIVE project. I use this snippet, right at the beginning of my baseclass, to define in which environment the flash client is running:
Actionscript:
-
if(stage.loaderInfo.url.indexOf("file:") != -1){
-
_configXmlPath = "config.xml";
-
trace("local file");
-
}else {
-
trace("Server");
-
domain = URLUtils.getDomain( stage.loaderInfo.url);
-
}
I hope this is seflexpainatory.
Or you could just randomize the “hue” color parameter which is handily a 0-360 scale in TweenFilterLite:
theHue = (Math.round(Math.random() * 360)) ;
TweenFilterLite.to(my_mc, 2, {colorMatrixFilter:{amount:1, hue:theHue}});
ActionScript 3: Using URLLoader to send and load server variables « Tushar Wadekar
here is the most accurate description on how to send vars to a server script from flash, without opening anew browser window
In AS3 only, you can now abort a loading operation, before it has completed.
Senocular has written a post about it here.
in summary:
var loader:Loader = new Loader();
var request:URLRequest = new URLRequest("image.jpg");
loader.load(request);
addChild(loader);
// abort loading if not done in 3 seconds
var abortID:uint = setTimeout(abortLoader, 3000);
// abort the abort when loaded
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, abortAbort);
function abortLoader(){
try {
loader.close();
}catch(error:Error) {}
}
function abortAbort(event:Event){
clearTimeout(abortID);
}
Nasty Yellow Highlight on Buttons When “Tabbing”When you’re in a flash movie and you hit the “tab” button to go from button to button flash likes to put a bright bold yellow highlight around the button that is awfully ugly and annoying. This is how you get rid of that awful yellow highlight that flash produces by default.
movieClipName.tabEnabled = false;
Note: this code will also make the button not “tabbable”. Now when you hit the tab button on the keyboard it will ignore that button all together. You can still utilize it with ‘getfoucus’.
if you have nested moveclips then use this code too:
parentMovieClipName.tabChildren = false;
No more nasty default yellow highlights around anything that is tabbable in your flash movies.
Nasty Yellow Highlight on Buttons When “Tabbing” « Gena’s Blurb
Tweensy, developed by the notorious "Lost in Actionscript" blog owner Shane McCartney. I am personally a fan of Greensock's Tweenlite package, and there aren't any AS3 projects I haven't used it, but I must say Tweeny is the first one that actually woke my attention. It seems slick, fast, (very fast), and best of all are the effect packages it can be extended with. I also tried out the abilities to tween along complicated motion guides, and must say, I was really waiting for that one!
I will keep a few of my experiments with it posted here, but hey, flash community, there is movement!!
http://www.lostinactionscript.com/blog/index.php/2009/01/05/tweensy-goes-public/
http://converticon.com/
small slim flex application where yo can upload your image and convert it into an .ico file.
Posted by sortofme on November 19th, 2008

A new tool I love using, first it is in AIR, secondly immensely useful, is from Arthropod this little AIR application that let's you trace debug messages even from an embedded swf.
I never was a fan of Adobe's debug flash player, as it sometimes did cause weird behavior, especially after upgrading to FF3. So this little Air app gives you a wide range of functions to organise your debug traces well, including coloring, clearing, even snapshots of current Application, as I said even for in HTML embedded swfs or Air apps.
give it a go:
simply add the class to your source, import and use it:
Actionscript:
-
import com.carlcalderon.arthropod.Debug;
-
-
//later:
-
Debug.log(this+" my debug message" )
there are many other ways to trace, read the documentation for more info
Posted by sortofme on October 28th, 2008
I often cam across the issue, especially when working with XML data, that I want to pass on many of the paths used for loading XML or other tyoes of media from the embedding source, rather than hard coding it into my swf. That is fine, but I always run into the problem, that during development, the paths actually used on the server are wwuite unhandy for my IDE development.
Thats why I document here how I usually handle this, by checking whether the file is being served from local, or whther it is on a server:
Actionscript:
-
if(stage.loaderInfo.url.indexOf("file:") != -1){
-
trace("Local");
-
_XMLPath ="album1.xml"
-
}else {
-
_XMLPath = root.loaderInfo.parameters.imageXMLPath;
-
trace("Server");
-
}
Recent Comments