all groups > flash actionscript > august 2006 >
You're in the

flash actionscript

group:

Calling multiple buttons on a timeline in a movieClip


Calling multiple buttons on a timeline in a movieClip Tim A. Setliff
8/6/2006 11:37:13 PM
flash actionscript:
I have a MC with individual buttons on a time line.
The script holds the frame on frame one for 3 seconds then moves to the next
frame
and stops there for 3 seconds and then moves down the line.

This is like a banner that changes advertisers every three seconds.
I can call the first button from the main timeline but no other buttons
work.

I've tried several options - I can do it in Director but am unable to do it
with actionScript.

Here is the code:
stop()
partners_mc.brown_but.onRelease=function(){
getURL("http://www.hvac-consultants.com", "_blank");
}
partners_mc.bfl_but.onRelease=function(){
getURL("http://www.bodyforlife.com", "_blank");
}

Thanks in advance for any help in this area.

Tim

Re: Calling multiple buttons on a timeline in a movieClip Tim A. Setliff
8/7/2006 12:49:02 AM
The movieClip in on the main timeline. The buttons are inside the movieClip
with
coding to move along the time line ever 3 seconds. The buttons are defined
in the
MC as buttons. Depending upon which button is visible, I want
to be able to click that button and have the script in the main timeline to
know
which button I'm using.

Here is a link to the web site which is under development - the movieClip
is
on the right hand side under Partners.

www.familyrx.org

Thanks,
Tim


[quoted text, click to view]

Re: Calling multiple buttons on a timeline in a movieClip WebXperience
8/7/2006 3:56:08 AM
You've defined the onRelease functions ok, it seems. But, I don't see how your
moving from one button to the next. Are the buttons defined as MovieClip
Objects or as Buttons? Are the "buttons" contained in another MovieClip Object
or are they on the Main Timeline?
Re: Calling multiple buttons on a timeline in a movieClip WebXperience
9/10/2006 5:06:14 PM
From looking at your site, it seems that the buttons are accually defined as
buttons and not as MoviClip instances. They seem to be already responsponding
to click events which is why the text change occurs.
Now, though current trends in ActionScript programming advise against placing
code on buttons, since you seem to have already written extensive code here,
my suggestion would be to place the action code into the function that is
causing the text to change. Granted you would have to repeat that code on each
one of the buttons. Which would be avoided if all the code was placed in one
place.
AddThis Social Bookmark Button