yes. another flash question
- Started
- Last post
- 10 Responses
- lvl_13
and before jazx tells me to search : ) i already did. no seriously.
this is perhaps the most simple thing to do, but for some reason i cannot figure it out. got a bunch of mcs that i need to make move.
code is as follows on each mc:
onClipEvent(load){
xDest = this._x;
speed = 3;
}onClipEvent(enterFrame){
xDiff = xDest - this._x;
xMove = xDiff/speed;
this._x += xMove;
}i need them to move at the start of the movie, which should be as easy as putting this code in the first frame of main timeline:
vone.xDest=500;
vtwo.xDest=100;
vthree.xDest=100;
//etc.doesn't work. driving me nuts. arrrrggh. any help? it works fine if i place a button on the screen and give it the code just above.
oh and to make it even more confusing some of the mcs have a button inside them and when pressed i would like it to move itself to a designated x but that also doesn't work. help please. i'll give you a gmail account 'cause they are so hard to come by ;) but seriously i need some help.
thank you
- JazX0
I would never tell you to search. *cough
- DutchBoy0
do a search, damnit!
*sorry, just wanted to be the new JazX here..
- JazX0
*high-five's Dutchboy
- lvl_130
stop hijackin' my thread : )
i did a damn search. i even looked at a bunch of files from jazx's link from and old thread http://www.podlob.com/download/
but shit, that stuff is way to in depths for me. i just back into doing flash and am finding out the hard way that i need to update all my old code libraries 'cause they are a no go in flash 7 AS 2.
so c'mon damnit someone help me........pretty please with sugar on top.
- DutchBoy0
email unfit
- JazX0
yep that's good advice
- lvl_130
hmmm... i don't know about that. i think if everyone that asks for him on this board also emailed him...that just sounds like it would get really annoying for him ya' know?
i'll just keep bugging all the rest of you :) now c'mon
- mpark0
you need to specify path of your variables. since xDest will be gethering it's information from the main time line try using "_root.xDest" inside of your clipevent script.
- fugged0
try adding this in front of the variables so they are local to the movie clip.
onClipEvent(load){
this.xDest = this._x;
this.speed = 3;
}onClipEvent(enterFra me){
xDiff = this.xDest - this._x;
xMove = xDiff/this.speed;
this._x += xMove;
}
- fugged0
didn't see the second part to your question
just set the xDest again after the button click.
just make sure your pointing to the correct place
prolly: _parent.xDest = whateva...
so..
on