Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Actionscript / October 2005



Tip: Looking for answers? Try searching our database.

Actionscript 1 to 2

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
debloom - 31 Oct 2005 20:37 GMT
Hey Everyone.
I just upgrade to Actionscript 2.0 and was trying to make my script compatible
with Actionscript 2.
When I publish my file with AS 1 Version 5 the movie works great, when I
publish it with AS2 Version 7 no go.

Can anyone help me out? I'm trying to figure what changed.

ATTACHED TO A MOVIE CLIP
onClipEvent (load) {
    movespeed = 10;
}
onClipEvent (enterFrame) {
    if (Key.isDown(Key.RIGHT)) {
        this._x -= movespeed;
        if (this._x<=-500) {
            setProperty("_root.scroll", _x, -500);
        }
    } else if (Key.isDown(Key.LEFT)) {
        this._x += movespeed;
        if (this._x>=120) {
            setProperty("_root.scroll", _x, 120);
        }
    }
}

IN A MOVIE CLIP

movespeed = 10;
if (_parent.scroll._x>=120) {
    gotoAndStop (1);
} else {
    _parent.scroll._x += moveSpeed;
}
Motion Maker - 01 Nov 2005 00:10 GMT
Capitalization of moveSpeed needs to be the same.

Signature

Lon Hosford
www.lonhosford.com
May many happy bits flow your way!

Hey Everyone.
I just upgrade to Actionscript 2.0 and was trying to make my script
compatible
with Actionscript 2.
When I publish my file with AS 1 Version 5 the movie works great, when I
publish it with AS2 Version 7 no go.

Can anyone help me out? I'm trying to figure what changed.

ATTACHED TO A MOVIE CLIP
onClipEvent (load) {
 movespeed = 10;
}
onClipEvent (enterFrame) {
 if (Key.isDown(Key.RIGHT)) {
 this._x -= movespeed;
 if (this._x<=-500) {
 setProperty("_root.scroll", _x, -500);
 }
 } else if (Key.isDown(Key.LEFT)) {
 this._x += movespeed;
 if (this._x>=120) {
 setProperty("_root.scroll", _x, 120);
 }
 }
}

IN A MOVIE CLIP

movespeed = 10;
if (_parent.scroll._x>=120) {
 gotoAndStop (1);
} else {
 _parent.scroll._x += moveSpeed;
}
Jeckyl - 01 Nov 2005 00:45 GMT
> Capitalization of moveSpeed needs to be the same.

And note that capitalisation is not as AS1->AS2 issue .. its a FP7 issue
(whether you use AS1 or AS2)
--
jeckyl
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.