Log in

View Full Version : What's the Deal with the Actionscript 3.0 in Flash CS3?



btelecky
02-28-2008, 01:23 AM
What did they do to my beloved flash! :eek:

I have just started using Flash CS3 at work, after using Flash MX pro for a couple years now...

I tried doing something extremely simple, like programming a button event. Click the button, it takes you to 'X' website. After creating the button, I first tried going through the 'behaviors' panel. Flash prompted me saying that I had to use an older version of actionscript.

I also found it odd that I couldn't use the actions panel either. It said that "actionscript cannot be applied to this object." Or something of that sort...
I was pretty disappointed with the help material provided. Anybody know why the developers changed up the actionscript? Anybody know how to pull off these simple 2.0 tricks in 3.0?

I'm a designer, trying to learn how to program... :eek:

Medyman
02-28-2008, 01:35 AM
What did they do to my beloved flash! :eek

They bad it better! :)

MX to CS3 is a pertty large jump to make. but once you get used to it, you'll grow to love it. It seems like a pain in the beginning, but believe me, it's SOO much more powerful.

As for your questions...
AS 3.0 doesn't support adding events to buttons. I suppose you were trying to do something like:


on(release) {
getURL("website");
}

That's a no no!:p That's partially why I always tell people here to get away from that convention.

The more proper way (with AS 2.0) is:


button_mc.onRelease = function() {
getURL("website");
}



Now AS 2.0 vs. AS 3.0

AS 2.0

button_btn.onRelease = function(){
output_txt.text = “Button was clicked!”;
}


AS 3.0

function eventResponse(evt:MouseEvent):void {
output_txt.text = “Button was clicked!”;
}
button_btn.addEventListener(MouseEvent.MOUSE_UP,eventResponse);


I know...tedious and looks like nonsense. The mouse events are done in a more verbose if not more confusing way but AS 3.0 is a lot more powerful.

With that said, there is a "Create a AS 2.0" Project option with CS3 (which I still use almost exclusively).


For more: http://designfission.com/blog/2007/09/16/first-step-into-as30/

BLiZZaRD
02-29-2008, 07:43 PM
MX to CS3 is a pertty large jump to make. but once you get used to it, you'll grow to love it. It seems like a pain in the beginning, but believe me, it's SOO much more powerfu


And there are those of us that still use Flash 5, Flash 7 (cause 6 sucked) Flash 8 and CS3, and realize how pointless the changes to CS3 are and think the new version is crap.

I am in that group. CS3 is a proprietary monolithic crap shoot that didn't do anything different except change the EMACs functions. Thus making you use silly code and longer code to accomplish the same thing.

Medyman
03-01-2008, 10:23 PM
CS3 is a proprietary monolithic crap shoot that didn't do anything different except change the EMACs functions. Thus making you use silly code and longer code to accomplish the same thing.


In Flash, absolutely agreed! That's why I still stick with AS 2.0 for Flash projects.

But for some more feature-rich applications using say Flex, AS 3.0 is a godsend.

BLiZZaRD
03-02-2008, 06:06 PM
Yeah.. but why re-invent the wheel, when a little JS or PHP can accomplish the same thing ;)

btelecky
03-03-2008, 08:18 PM
I ended up using actionscript 2.0 for my behavior. So I just needed to make an invisible button with an 'on release' behavior to go to a URL. But for some reason when the button is clicked, nothing happens. I am no flash expert, but I am far from a novice. I don't understand why these simple things won't work, the way that they should. I hope that this isn't another CS3 type glitch.

on (release) {

//Goto Webpage Behavior
getURL("http://www.adobe.com","_blank");
//End Behavior

}

Medyman
03-03-2008, 11:27 PM
on (release) {

//Goto Webpage Behavior
getURL("http://www.adobe.com","_blank");
//End Behavior

}

That should work...
Are you sure it's on the right movieclip?

Try adding the AS to a frame instead of the actual MC.

button_MC.onRelease = function() {
getURL("http://www.adobe.com", "_balnk");
}

where button_MC is the instance name for the movieclip that you want to act as the button