Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Sep 2004
    Location
    Brazil
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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?

  • #3
    New Coder
    Join Date
    Sep 2004
    Location
    Brazil
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    New to the CF scene
    Join Date
    Apr 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •