Latest posts to the library

1180 Call to a possibly undefined method navigateToURL If you get the above error when trying to run your flash actionscript 3 file, you are obviously trying to use the navigateToURL() function but have not imported the flash.net library code. The following code before everything will correct the problem. import flash.net.*; ..or a more of [...]

It is really easy to create a Timer in Actionscript 3. Instantiate the Timer Class and pass a time in millions of 1000 to it to work in seconds. var myTimer:Timer = new Timer(1000); Setup an event listener to call a function. myTimer.addEventListener("timer", myTimerEventHandler); Start the Timer. myTimer.start(); Start the Timer. function myTimerEventHandler(event:TimerEvent):void {   [...]

Split string into sentences by max line length. This uses a character array but doesn’t use word-wrapping. var personalMessage:String = "You got this far so we reckon that you could be curious enough to learn a little more, we’ll contact you shortly to answer any questions you may have."; _root.myArray = new Array(); _root.myArray = [...]

This is how to add text leading using Actionscript 2 for Flash. var txtFormat:TextFormat = new TextFormat(); txtFormat.leading = 5; // change this to whatever you need it to be ttt.setTextFormat(txtFormat); ttt2.setTextFormat(txtFormat);</span> There is also a GUI way of doing this: Select your textfield and and under the paragraph section, set the top/right hand icon [...]

Error 1046: Type was not found or was not a compile-time constant: Event. You need to import the Event class! import flash.events.Event

I needed to work out a date range according to the date 3weeks away from the current date. After a bit of thinking, I found that it’s actually quite easy to achieve. var theDate:Date = new Date(); dateDay = theDate.getDate(); dateMonth = theDate.getMonth(); dateYear = theDate.getFullYear(); var theDate2:Date = new Date(dateYear,dateMonth,dateDay); theDate2.setDate(theDate2.getDate() + 21); dateDay2 [...]

I have been working on a project where I need to select a date range starting today and ending a month from now, so the user cannot select anything in the past or over a month from now. This is how I did it: There is an instance of DateChooser on the stage with Instance [...]

if (mc.hitTest(_root._xmouse, _root._ymouse, true))) {         trace("hitTest Run"); }

An animation done showing the battle between animator and the animation in a Flash environment. Thanks to Alan Becker for this one.



back to top