Reply LinkBack Thread Tools Search this Thread
Old 02-09-2005, 05:37   #1 (permalink)
elly
Arf arf
 
elly's Avatar
 
Join Date: Jan 2005
Location: Bath, England
Posts: 31
Help with Flash: a simple prob I'm sure...

Ok peeps, I have a wee little problem. I’m almost there in understanding it, but I’d be grateful for a helpful push in the right direction.

Rather than giving you all the details of the confusing thing that I’m putting together, I’ll spare you all the irritation and instead use the idea of an animated ‘ball’.

I have a movieclip ("ball_mc"), inside which is an animation of a ball that moves from A to B (there is a stop here), then back to A. I have placed an instance of this movieclip ("ball_mc_1") on the main timeline and would like it to be controlled by a button. Upon rollOver of this button, I would like the movieclip to play so that the ball travels from A to B and stops, then when you rollOut I would like rest of the movieclip to play so that the ball travels from B back to A.

What actionscript do I have to put on this button to achieve this?

I am still trying to grasp the idea of controlling a movieclip’s timeline within another timeline but am unsure of exactly what script to write to do that. I know that this is really a simple problem but your help would be VERY much appreciated.
  Reply With Quote
Old 02-09-2005, 05:42   #2 (permalink)
d*d
Senior Member
 
d*d's Avatar
 
Join Date: Oct 2004
Location: Bristol
Posts: 3,155
i wouldn't use the timeline, i would use the 'ball_mc_1' _x positioning. so give 'ball_mc_1' an instance name of 'ball' if the button is in the 'ball_mc' movieclip it would have an on Mouse rollover command which would contain ball._x += 5, and on rollout ball._x -= 5, stick these commands inside an if conditional which would have the maximum and minimum distances (if (ball._x>20)&&(ball._x<300){})
  Reply With Quote
Old 02-09-2005, 08:06   #3 (permalink)
jase1000
turd 2.0
 
jase1000's Avatar
 
Join Date: Aug 2005
Location: Right on your tit end
Posts: 1,166
or you could use a hit test and the nextFrame() prevFrame() command to control the timeline of your MC. Make an invisible MC with the name hitTestClip or something (for your hit area) and place this code in your ball MC. Put a stop() at the last frame of your animation.

if (_root.hitTestClip.hitTest(_root._xmouse, _root._ymouse, false)) {
this.nextFrame();
}
else {
this.prevFrame();
}

Then just stick an invisible button over the top for the link.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8