Go Back   CodingForums.com > :: Client side development > Flash & ActionScript

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-11-2005, 05:53 PM   PM User | #1
gaBRiel
New Coder

 
Join Date: Sep 2004
Location: Brazil
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
gaBRiel is an unknown quantity at this point
Button Within a Simble? (Flash)

Is there a way to place a button inside a simble?
I mean... I know you can... I was wondering if you could place an action to this button put it inside a simble and still make it work?
so... first you have to create the button simble... then... create another simble... in this second simble you insert the button simble and add an actionscript or url to it. My question is: when you click on the button when it is inside the second simble... will the actionscript be executed?
... hope I made myself clear
thanx,
gabe
gaBRiel is offline   Reply With Quote
Old 02-11-2005, 08:52 PM   PM User | #2
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
i think you will have to mask the top button with the 2nd button, but y would u want to do such a thing? y not just make one button with different up down over and hit states?
_Aerospace_Eng_ is offline   Reply With Quote
Old 02-12-2005, 01:23 PM   PM User | #3
gaBRiel
New Coder

 
Join Date: Sep 2004
Location: Brazil
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
gaBRiel is an unknown quantity at this point
yeah... I know it sounds ridiculous do do such a thing... But I was actually thinking of maybe adding more than one button to a simble. So by placing ONE simble I would actually place like three or four buttons. Why would I want to do that? Because this way I could easily create a motion tween for the buttons. ´cause if you place several buttons on one layer and try to make motion with them, the motion will look wierd... right? but if I had only one simble I could do a smooth motion tween. so really my point was to make a movie simble or something and in this simble add other button simbles(so the movie simble would have actual buttons inside it)... the problem is that if I add actionscripts to these buttons they won´t work since the actionscripts are INSIDE the simble and not ON it.
so... I guess what I really am wanting to know is how to add and actionscript inside a simble and still make it work when I place the simble in the movie clip... sorry... Im having a little bit of trouble explaining myself
gaBRiel is offline   Reply With Quote
Old 04-05-2005, 02:52 PM   PM User | #4
threeandcats
New to the CF scene

 
Join Date: Apr 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
threeandcats is an unknown quantity at this point
gaBRiel,

Yes, you can put action script on a button or buttons and then save them with their actionscript attached as a movie clip symbol. The buttons can still do their action script even though they are inside the movie clip. You need to be careful with your paths though, because buttons inside a movie clip are not part of the main timeline. For example, if you want the main movie to stop when a button is clicked, you need to put _root.stop(); and not just stop(); in your button script. Also, if you are passing variables to the button from the main timeline, you need to specify them as global variables: _global.myvariable="widget" NOT just myvariable="widget"

On the other hand, couldn't you put each button on its own layer in the main timeline and do your motion tweening that way?

Hope this helps!
threeandcats is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:24 AM.


Advertisement
Log in to turn off these ads.