Link to home
Start Free TrialLog in
Avatar of coma12
coma12Flag for United States of America

asked on

Help Please! Need to remove flash movie from webpage after clicking a button in movie

Hello,

I have made a flash movie on a layer that needs to disapper either with or without the layer when a button on the movie is clicked. You can see the demo page at www.reedh.com/newsletter/defaulttest.htm. if you click the click here button it goes nowhere for now.

Thanks a bunch!

Coma12
Avatar of coma12
coma12
Flag of United States of America image

ASKER

thanks
hi coma12,
You can use this attached to that button:

on(release){
removeMovieClip(_root.mc_name);   <---- mc_name is your movieClip INSTANCE name.
}

Cheers :)
SokhodoM
Avatar of coma12

ASKER

SokhodoM,

I can't seem to get this to work correctly it is my lack of actionscript skills I am sure. Here is the script that I have for the button, maybe you can see what is wrong.

on (press) {
      getURL("http://www.reedh.com/popup.htm", "_blank");
}
on(release){
removeMovieClip(_root.postitclip); <-------This is the name of the postit note movie clip instance. I did not have this in my script.
}

I'm not sure which movie clip you are refferencing to. I have 1 movie clip instance that is the postitnote on it's own layer then a second layer that is the invisible button instance called clickhere that is in another layer. Those are the only two layers I have. The actual fla and swf is called postitnoteflash. Again the demo is at www.reedh.com/newsletter/defaulttest.htm.

Thanks for help on this

Coma12
the actionscript on the button is perfectly allright. What is wrong here , I believe is the (_root.postitclip)
You need to Name the INSTANCE of the Postitnote MovieClip as postitclip to get the above action to get working.
look here: http://www.ntu.edu.sg/home2001/n0069866/instance.jpg 
Note on the instance name. and also make sure your movie clip is on the main timeline.
by the way, if you can't really get it working, you can the .fla to me
Avatar of coma12

ASKER

sokhodom,

I think I am all jacked up in my timeline/movieclips. I feel really bad having to send you the file and not being able to figure it out based on your help but since you offered and I am quickly running out of time...Here is the .fla file.
http://www.reedh.com/newsletter/postitnoteflash.fla

Thank you so much again...

Coma12

ASKER CERTIFIED SOLUTION
Avatar of Member_2_1840827
Member_2_1840827
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of coma12

ASKER

SokhodoM,

Thank you, thank you. You have gone above and beyond what is expected at EE. and thanks again.

Just for future referrence why did the script change based on my file?

Thanks (yet one more time)

Coma12
you are welcome :)
In fact, there are many ways in dealing with flash. Just that for your case, to make simpler, it's better to use _visible. Well, usually, RemoveMovieClip is used when the movieclip is created dynamically.
Cheers :)
SokhodoM