actionscript movement Q
- Started
- Last post
- 3 Responses
- ganon
im working on a .fla that has a bunch of scrolling MCs...once a clip gets to a certain point, i want the main timeline to jump to a keyframe and start the next one...this is what i have on the first MC, which works...but applying this code to the second clip and changing the keyframe label, the timeline does not jump to the next keyframe as specified....why, help please...:
onClipEvent(load) {
speed = -3;
}
onClipEvent(enterFrame) {
currentPosx = this._x + speed;
this._x = currentPosx;
if (currentPosx < (170 - this._width/2)) {
_root.gotoAndStop ("two");
}
}
- ganon0
if anyone has any ideas, i would appreciate hearing your thoughts...i am supposed to have this done soon...!
thanks
- ganon0
ok, what i am trying to accomplish is to have a stream of scrolling MCs following each other...2-3 would be visible at once...once one gets to a certain point depending on its width (all have different widths) the timeline jumps to the next keyframe with a new scrolling MC in it to follow the original...why would this code work for the first MC but not the second...?
thanks
- honda0
it worked for me. used same code just added a line or two. other than that i had no problems.
here is what i used:
onClipEvent (load) {
speed = -3;
xPos = this._x
//disregard below
// _root.myXpos2.text = xPos;
}
onClipEvent (enterFrame) {
currentPosx = this._x+speed;
this._x = currentPosx;
if (currentPosx<(170-this._width/2... {
_root.gotoAndStop("three");
}
if (currentPosx < 0) {
this._x = xPos;
}
}