Skip to main content
Known Participant
September 2, 2010
Question

Dummy Guide needed for converting AS2 code into AS3

  • September 2, 2010
  • 1 reply
  • 846 views
I have to convert my existing AS2 code into AS3, but I might as well be reading chinese. I never even began to learn AS3, it was still fairly new at the time and the class ended before we had an opportunity to even touch on it. My major was not web design, it was the print side of design. I took an additional class, after I graduated, to learn web design and our teacher told us, basically, that we were designers, not coders so we won't be getting much into actionscripting, beyond the basics. At the time I was relieved, but looking back, I really wish we would have gotten more into it. Bottom line, I need to learn now.
Is there ANYONE that can help me out? I will list my code below, buy I am way beyond lost any help that can be provided, I would be so grateful!!!!

On the main timeline I have the basic..

stop(); -- I found the AS3 version, but I don't know what I'm looking at. I get "not_yet_set.stop()" and there are are 8 options I can choose from. I just want the timeline to stop until I tell it where to go next. And what is "not_yet_set"

Then I have my buttons, which are, basically...


on (release) {
gotoAndStop("Home");
}

Or "gotoAndPlay("Whatever");"

I also have buttons for scrolling...

on (press) {
play();
}

on (release) {
stop();
}

AND

on (press) {
_root.AboutMe_Controller.gotoAndPlay(…
}

on (release) {
_root.AboutMe_Controller.gotoAndStop(…
}
For the on(release) command, this is what I found as the AS3 version: not_set_yet.dispatchEvent()
This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
September 2, 2010

because that's really as1 code, you have steeper learning curve than going from as2 to as3.

first, remove all code from objects, assign instance names to your buttons and you can then start on as3:

// so, if you name your home button, home_btn:

home_btn.addEventListener(MouseEvent.CLICK,homeF);

function homeF(e:MouseEvent):void{

gotoAndStop("Home");

}

p.s.  the not_yet_set stuff is there because you tried to use script assist or some other actionscript shortcut.

bnies813Author
Known Participant
September 15, 2010

Thanks for your help. I'm still learning AS3, it coming to me slowly, but you're response was helpful.

kglad
Community Expert
Community Expert
September 15, 2010

you're welcome.