Flash Advisor logo
:: Desktop Shortcut
:: Flash Help
Advice from Experts

Closed Thread
Results 1 to 6 of 6
  1. #1

    Default help, how do you link a button to a layer??

    i'm in the process of attempting to make my first flash site, and i'm really stuck on one major point,
    basically i have a button, and when it is selected i would like some of the other layers to alter and turn into buttons, i hope this makes sense.
    please help, i've been attempting to figure it out for ages, i just can't do it!

  2. # ADS
    Join Date
    Always
    Posts
    Many
     
  3. #2
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    Flash cant change symbol instances at runtime, ........or you can only change a movieclip to a button in authortime. If you mean that you want something to occur in another movieclip or another part of the movie when you roll your mouse over or select a button, you would need code that tells your button to handle the events of mouseover or mousedown. If that event occurs.... do something. Post a code demo of what you are trying to do.

    NTD

  4. #3

    Default

    hi thanks for your reply, basically at the mo, the main theme of the website is hexagons, some are plain, some are buttons, each hexagon is a layer, when the user clicks on particular buttons, i want some of the plain hexagons to turn in to buttons. I've already created the buttons that i want the plain hexagons to to turn in to. at present i have layered them over the top of the plain hexagons,
    will i have to make the appearing buttons in to a movie or something? i have been told that it can be done using slides or something?

  5. #4
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    That's one of the cool features of flash. You can achieve similar results through many different methods.

    Sliding...
    You could put the buttons that you want to activate inside a movieclip with a mask layer. When the target button is selected, you could use a motion tween to slide the button into view underneath a mask.

    Visibility....
    You could create a button over the top of each hexagon graphic and toggle the visibility property of each button as it is needed. Setting visibility to false disables button actions. Setting an _alpha to 0 is not the same thing. It removes visibility but button actions still work.
    _root.mcName._visible = false;

    Attatch......
    You could create a master button in your library and set the linkage options. Then you could use the attatchMovie method to attach a button whenever or wherever you need it.
    _root.attatchMovie("libraryName","newName",depth);

    Enabled..
    You could create invisible buttons....(buttons with a graphic in the hit frame only) and then toggle the enabled property of the button.
    _root.buttonName.enabled = false;


    One thing that will help most projects is planning ahead of time what you want to achieve. It is easy to open flash and "wander" from one method or idea to the next without completly thinking one through. If you plan in as much detail as you can what you want to achieve before you ever open flash, it will speed your production and learning up as you will focus more on individual methods rather that all the options flash has.

    HTH
    NTD

  6. #5

    Default

    hi there, thanks again for your reply, i have now managed to create a movie for the target buttons, however i am having trouble with the linkage, i have used the code that flash recommends and i still can't get it to work,

  7. #6
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    Post the code you are using.

    Demo.... create a square on the stage and convert it into a movieclip symbol then delete it from your stage. Open your library and select the movieclip right click it and set the linkage....

    id name...... box

    export for first frame selected

    Then put this code on the first frame of your test movie.....

    Code:
    _root.onEnterFrame = function() {
    	myBox = _root.attachMovie("box","newBox",10);
    	myBox._x = _root._xmouse;
    	myBox._y = _root._ymouse
    };
    This will attach the movie from your library to the mouse position. You can set the position to constant by changing the event handler.... onEnterFrame ..... to onLoad..... or whatever.

    HTH
    NTD

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. editing a exciting button link
    By k2 in forum Newbies
    Replies: 0
    Last Post: 09-30-2006, 01:02 AM
  2. Button doesn't work in link Help!!!
    By Ubermensch in forum Newbies
    Replies: 3
    Last Post: 09-23-2006, 07:03 PM
  3. how can i link a web site with a button
    By martin2ez13 in forum Newbies
    Replies: 5
    Last Post: 06-20-2006, 06:11 PM
  4. One layer with loop and another play once in same FLA?
    By Edouble in forum General Flash
    Replies: 1
    Last Post: 07-14-2005, 01:35 AM
  5. How do I link a button to a quiz?
    By adamsears01 in forum General Flash
    Replies: 1
    Last Post: 03-30-2005, 03:56 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Sponsors
Create Speaking Characters for your website and Flash movies. 15 Day Free Trial