Latest posts to the library

I needed a quick and easy way to check for the basics of an email address. Does it contain “@” and “.” symbols. This is by no meals a foolproof method, so don’t use it for anything big, but if you want to just do a quick test then here you go: var email:String = [...]

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 {   [...]

In the below example we will use Actionscript 2 to call a remote PHP file that will return data to it. It is a simple way of transferring data between the server and client. Actionscript 2 Code: callRemoteFile = function(ourVariable:String) {         var result_lv:LoadVars = new LoadVars();     result_lv.onLoad = function(success:Boolean) [...]

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 [...]



back to top