PDA

View Full Version : AS2 Help



MadHatter
04-02-2008, 07:53 PM
I am currently trying to learn a little bit of actionscript. So I have made a couple of really short things using tutrials and such, but I have recently started a project. I am wanting to make one of the old school arcade shooters. I have the ship and the code to make that move, but I want to know how to make a barrier so I can't fly the ship off into nowhere. I have searched the internet looking for help on this subject, but I can't find anything. I was wondering if anyone would like to help me with this project.

Steyene
04-02-2008, 09:08 PM
Make a variable on the frame called globalx and make it equal to the width of your .fla

Then enter this on your ship


If this._x > _root.globalx){
this._x = 0;
}
if(this._x < 0){
this._x = _root.globalx;
}

darkcampainger
04-02-2008, 09:20 PM
Make a variable on the frame called globalx and make it equal to the width of your .fla

Then enter this on your ship


if(this._x > _root.globalx){
this._x = 0;
}
if(this._x < 0){
this._x = _root.globalx;
}


You've got that reversed. If _x is less than zero, you want to set it to zero. If _x is greater than globalx, you want to set it to globalx.

Komaru
04-02-2008, 09:25 PM
http://www.stickpageportal.com/forums/showthread.php?t=57552&highlight=duplicatemovieclip

Steyene
04-02-2008, 09:45 PM
Did I campaigner ?

darkcampainger
04-02-2008, 10:18 PM
Did I campaigner ?

Oooh, burn. :P
I know it's misspelled, and have known long before I created this account. I keep it that way for... I can't remember why. I guess I'm just used to it. :P

MadHatter
04-03-2008, 09:10 PM
Thank you for the link.