PDA

View Full Version : on release button doesnt work in cs3 but does in flash 8



kat_d
July 31st, 2007, 03:42 AM
Hi,

I have created a flash file in cs3 with a button having the following code:

on (release) {
getURL('https://websitenamehere');
}

when i publish and save the file as cs3 and open the swf or html file, the on release button doesnt work.

If i then publish and save the cs3 flash file as flash 8, the button then works when i open the swf and html files.

Why is this? Why doesnt the on release button work on cs3 files?

Please help :)

thatguythatsme
July 31st, 2007, 07:59 AM
Change the setting your publishing your swf to, to ActionScript 2. 'on (release)' doesn't work in ActionScript 3. If you want to do it in actionscript 3 then you need to look into using EventListeners.

David

GrndMasterFlash
July 31st, 2007, 02:00 PM
Change the setting your publishing your swf to, to ActionScript 2. 'on (release)' doesn't work in ActionScript 3. If you want to do it in actionscript 3 then you need to look into using EventListeners.

David

or use some AS3 script

function mouserelease(event:MouseEvent):void {
//your actions here
}
stage.addEventListener(MouseEvent.MOUSE_UP, mouserelease);

you might as well start using AS3, AS2 will be dead in a couple of years, just like AS1 before it

:cowboy: