How to use a Timer in Actionscript 3

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. [code lang=”actionscript”] var myTimer:Timer = new Timer(1000); [/code] Setup an event listener to call a function. [code lang=”actionscript”] myTimer.addEventListener(“timer”, myTimerEventHandler); [/code] Read more…

By Andrew Odendaal, ago

Actionscript 2 & PHP Data Transfer

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: [code lang=”actionscript”] callRemoteFile = function(ourVariable:String) { var result_lv:LoadVars = new LoadVars(); result_lv.onLoad = Read more…

By Andrew Odendaal, ago

Add a date to a date in Actionscript 2

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. [code lang=”actionscript”] var theDate:Date = new Date(); dateDay = theDate.getDate(); dateMonth = theDate.getMonth(); dateYear = theDate.getFullYear(); var theDate2:Date Read more…

By Andrew Odendaal, ago

Enable / Disable Cursor Hand in Actioncsript 2

If you have a movieclip that by default has the hand cursor showing on RollOver and you don’t really want this, you can disable it by doing the following: myMC.onRollOver = function() { this.useHandCursor=false; } So the main code here is: this.useHandCursor=false; False disables it and true shows it.

By Andrew Odendaal, ago