A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: How to hide layers with buttons

  1. #1
    Member
    Join Date
    Jan 2003
    Location
    Melbourne
    Posts
    35

    How to hide layers with buttons

    There is a layer on my application which i want the user to be able to hide if they wanted to, by clicking a button.

    hiding a layer in the timeline while creating a flash (clicking the eye dot thing which makes a cross on the dot and hides the layer)... this is the function i want a button to do... and undo by clicking a second time.

    thank-you in advance.

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    place the content of the layer inside a movieclip.
    give this clip an instance name - clip1
    the button toggle action to hide the clip -

    on(press){
    if ( hide ){
    clip1._visible = true;
    } else {
    clip1._visible = false
    }
    hide = !hide;
    }

    hth

  3. #3
    Member
    Join Date
    Jan 2003
    Location
    Melbourne
    Posts
    35
    unfortunately i cant place all the contents into a movie clip, because the contents is multiple movie clips over a hundred and fifty frames... can something similar be done... but to the layer and not a movieclip?

  4. #4
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    layers are an authoring conveniance only, when fla becomes swf they are flattened into one layer,
    you can A) use the _visible property on all of your movieclips to hide them, or B) direct the timeline to a frame that does not include your movieclips,( or where their _x and _y properties are set well off the stage area)

    hth

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center