ActionScript 2.0 :: Code Does Not Work After Using The Close Button To Unload The Movie?

May 21, 2007

i have a movie called with:

Code:

_root.attachMovie("biography", "biography", _root.mylogo.getDepth()-1, {_x:Stage.width/2, _y:Stage.height/2});
and within each i have a close button with:

Code:

close_bt.onPress = function() {
unloadMovie(_root.biography);
};

but now i have a problem, im trying to use:

Code:

if (!_root.biography) {
_root.attachMovie("biography", "biography", _root.mylogo.getDepth()-1, {_x:Stage.width/2, _y:Stage.height/2});
}

to call the move again if there isnt already an instance of it but it only works the first time the movie was called, it wont work after i use the close button to unload the movie..

View 6 Replies


Similar Posts:


ActionScript 3.0 :: Unload Loader / Remove Child / Close Button

Oct 16, 2011

i successfully managed to work out the loader script, and load a external swf file into my current project. Now that its working and all is well, i realised that only way to get back to 'main menu' was to close the whole thing. I tried to sort it out with a simple 'back' button but no success there. As mentioned in the title thats the options i found so far but cant seem to quite understand them tbh. I just want it to work so that I easily can manouvre back to 'main menu'.

View 2 Replies

ActionScript 3.0 :: Button Inside A Movie Clip Code Doesn't Work?

Dec 17, 2010

I have a button instanced "howto_weblink_btn" which is located inside a MC instanced "HowTo_maininfo_mc". I would like to write a code allowing me to access this button from the main navigation menu. Here is what I come up with:

HowTo_maininfo_mc.howto_weblink_btn.addEventListener(MouseEvent.CLICK, onClick_openJTV);
function onClick_openJTV(event:MouseEvent) :void {
HowTo_maininfo_mc.navigateToURL(new URLRequest("http://www.ubloom.com/index.php?

[code]......

View 7 Replies

ActionScript 2.0 :: GotoAndStop Code Doesn't Work After I Convert A Button To Movie Clip?

Feb 3, 2005

what happened in my flash document was, I created a button, "next_btn" with the following commands:

on(release){
//to remove all the splats
for (score=0;score<100;score++){[code]...

At this point, almost everything worked perfectly. Everything, but one thing. Apparently, the swapDepths command wasn't working. It was then that I thought maybe swapDepths only works on movie clips.And so I converted the button into a movie clip. I modified the instance names, etc, and almost everything worked. Everything, including swapDepths, but one thing: the gotoAndStop command.For some reason, when I tested the movie clip (containing a button) out, it removed the splat+score and finger_mc movie clips, as well as stoped the background music from playing. However, it did not go to the next scene and frame as specified by the gotoAndStop command. "s1a2" is the next scene, and "gameplays1a2" is its frame.

View 3 Replies

ActionScript 2.0 :: GotoAndStop Code Doesn't Work After Convert A Button To Movie Clip

Feb 3, 2005

First of all, I would like to apologise for not knowing whether this code belongs to F5 or FMX Action Script. I'm that noobish, yup. Anyway, what happened in my flash document was, I created a button, "next_btn" with the following commands:

[Code]...

At this point, almost everything worked perfectly. Everything, but one thing. Apparently, the swapDepths command wasn't working. It was then that I thought maybe swapDepths only works on movie clips. And so I converted the button into a movie clip. I modified the instance names, etc, and almost everything worked. Everything, including swapDepths, but one thing: the gotoAndStop command.

For some reason, when I tested the movie clip (containing a button) out, it removed the splat+score and finger_mc movie clips, as well as stoped the background music from playing. However, it did not go to the next scene and frame as specified by the gotoAndStop command. "s1a2" is the next scene, and "gameplays1a2" is its frame.

View 3 Replies

Professional :: Can't Get Close Button To Work

Dec 9, 2011

am using flash cs5.5, action script 3 and can't get my close button to work. the code is below. if you are able to help me that would be wonderful.
 
tried this:
 
// add an EventListener to the button
Vid.addEventListener(MouseEvent.CLICK, buttonClick);
// the function that runs when after button was clicked

[Code].....

View 3 Replies

ActionScript 3.0 :: Code For A Button To Open And Close Pop-up Swf File?

Jan 21, 2010

I created this web page in Flash AS3 and I need codefor a button that will open and close pop-up swf file on stage, not in a new window.

View 1 Replies

ActionScript 2.0 :: Getting A Close Button To Work Within A Mc Popup Box

May 24, 2011

Have been having difficulty with this issue of getting a close button to work within a mc popup box (it is doing my head in !) Basically I have a Button on the stage that launches a popup mc. To close this popup, I have a 'x' for the user to click on to close this box. I don't want the box to become 'invisible' or for the whole box to close when clicked on (I have tried both but not what i am after). It is important for user to be able to relaunch this box by clicking on the button after closing previously.

It would be great if anyone would be able to view the fla atatched and explain what needs to be included, and perhaps upload a working verison.

View 4 Replies

ActionScript 3.0 :: Unloading A Loaded External SWF With A Close Button On The External SWF To Unload?

Aug 15, 2011

[URL]I have: main.swf (a menu) and I have module.swf (content)If you navigate to Subsea Wellhead Systems/SS-15 BigBore II and click on that I have it load an external swf which covers most of the parent. So far so good. My problem is unloading the loaded 'Child' swf with the button provided on the loaded 'Child' swf.below is the code I used to load the file but I cant, for the life of me, find a way to unload it. 
 
var bigboreLoader:Loader = new Loader();btnbb2.addEventListener(MouseEvent.MOUSE_UP, bigborecontent);
function bigborecontent(event:MouseEvent):void{var bigboreRequest:URLRequest = new URLRequest("moduletemplate.swf"); bigboreLoader.load(bigboreRequest); stage.addChild(bigboreLoader);
 
I am certain it requires the Child to communicate with the parent somehow but I am at a loss. If I could get a bit of advice or a link to something deal with this, it would be a big help. I just need to have my links load my modules and the remove them when the close buttong is hit on the loaded swf. I promise I have done searches and I admit I have found asnwers but still they are not working. I found the code below:
 
Main FLA: 
function removeF() {
removeChild(bigboreLoader);
}

[code]....

View 10 Replies

ActionScript 2.0 :: Clickable Close Button On Rolloff Panel Code?

Apr 11, 2011

I've got a job for an expandable MPU in AS2. When you rollOver the MPU it expands and has a rollOff button covering the whole of the expanded part. But I have also got a Close button on the expanded panel that you have to click to also retract the panel. what the code is to allow you to rollOUT of the expanded panel part but onto the Close button without it retracting before you click on it.

View 1 Replies

IDE :: RemoveChild - Make The Close Button Work On Project?

Feb 3, 2010

trying to make the close button work on this homework project. This app scatters photos on the stage, randomly and at random angles. They are drag and droppable and the clicked photo comes to the fore. Each photo has a close button intended to remove the photo from the stage, this last is what won't work. I know its a common topic, but nothing I've tried has worked so far. onClickCloseBtn is the problem.

Code:
package
{
import flash.display.*;[code]........

View 1 Replies

ActionScript 2.0 :: Code In On Loaded Movie Won't Stop After Unload

Oct 8, 2009

This is a PAIN. I always get grief if i try to use 'pause timline' code of any sort.[code]...

The 'CLOSE' button under it, unloads the level the vid sits in plus the butterflies swf just incase this devil code is still lurking. So go ahead and close it. And wait a few seconds and the WHOLE site loops.

View 9 Replies

IDE :: Child SWF Close/unload Itself?

Nov 14, 2009

I have a parent SWF into which I load a child SWF. I want to have a close button in the Child SWF (not the parent!) which closes/unloads it from the parent swf. Been looking all over but can't find any solutions that work.Here's my code for loading the child SWF from the parent's timeline:

var myrequest:URLRequest=new URLRequest("child.swf");
var myloader:Loader = new Loader();
myloader.load(myrequest);[code]...

What should I put in the child SWF to unload itself?

View 11 Replies

ActionScript 2.0 :: Unload Movie Then Load Another Movie Same Button?

Jun 5, 2004

can I script a buttons to unload a movie clip or swf, then load a different movie?

View 6 Replies

ActionScript 3.0 :: Child SWF Close / Unload Itself

Nov 14, 2009

Experience: I'm a newbie to AS3 - making the transition from AS2. Problem: I have a parent SWF into which I load a child SWF. I want to have a close button in the Child SWF (not the parent!) which closes/unloads it from the parent swf. Been looking all over but can't find any solutions that work. Here's my code for loading the child SWF from the parent's timeline:

var myrequest:URLRequest=new URLRequest("child.swf");
var myloader:Loader = new Loader();
myloader.load(myrequest);
myloader.contentLoaderInfo.addEventListener(Event. COMPLETE, movieLoaded);
[Code]...

What should I put in the child SWF to unload itself? Apologies if this presumably simple task has been covered, please point me to the thread.

View 5 Replies

ActionScript 3.0 :: Difference Between Close() And Unload()

Nov 5, 2009

I'm having a bit of trouble undestanding the difference between close and unload. Do I have this right? loader.close() stops the current load in progress by disconnecting the data stream between the URLRequest to the LoaderInfo object - so calling the load() method again in the future reopens this connection and continues downloading the file where it left off

loader.unload() stops the current load in progress if called before complete, removes the LoaderInfo object from the Loader - so calling the load() method in the future creates a new LoaderInfo object and starts a whole new download - if other objects have references to the removed LoaderInfo object it won't be deleted

View 4 Replies

ActionScript 2.0 :: Close Browser By Clicking On Close Button Embedded Swf?

Jul 27, 2009

i want to close browser by clicking on close button embedded swf. I have tried fscommand("quit"), but which is not working on browser.

View 9 Replies

ActionScript 3.0 :: Button - Close The Flash Movie And The Popup Window

Nov 25, 2009

I have an html page with a link that loads a popup window. The popup includes a simple Flash movie. Some basic Javascript code in the html file was used to produce the popup window. What Im trying to do is have a button that I created in the Flash app close the Flash movie and the popup window.

View 2 Replies

ActionScript 2.0 :: Fscommand() - Movie Close When The User Clicks A Button

Apr 21, 2004

I have a movie that i want to close when the user clicks a button, i know to use the fscommand(), but i duno what to put inside the brakets:S. i tyred 'close', 'close.screen','scree.close','unloadMovie'...etc but notings working, what im supposed 2 put in there?

View 2 Replies

ActionScript 3.0 :: Close Button (Change Movie Clip To 1st Keyframe)

Apr 9, 2010

This actionscript 3 stuff is giving me trouble with the easiest functions. I was able to get a movie clip to play by clicking on a button, but now I am having trouble with the close button. Basically, I just need the movie clip (box1) to go back to frame number one when the user clicks on the "X". I set up the button the same way as I did the pop-up box:

[Code]....

View 4 Replies

ActionScript 2.0 :: Load/unload Movie With Same Button?

Aug 30, 2010

I'm using CS3 with Action Script 2.

I have a button that loads an outside .swf into a blank container. That works fine, however, I want to use the same button to unload that movie. Basically I want it to work as a toggle button.

View 10 Replies

ActionScript 3.0 :: Unload Movie Button On External Swf?

Jun 29, 2010

i have a homepage - home.swf, with a button - btn_menu, that loads menu.swf.

btn_menu.addEventListener(MouseEvent.CLICK, menu);
function menu (e:MouseEvent):void{
var request:URLRequest = new URLRequest("menu.swf");

[Code].....

the above part gives an expanded menu and it works fine. now i have a minimize button on the menu - btn_mini, that effectively removes the menu.swf

btn_mini.addEventListener(MouseEvent.CLICK,unloads wf);
function unloadswf(event:MouseEvent)
{

[Code].....

View 9 Replies

ActionScript 3.0 :: Unload Movie Then Load New One With Same Button?

Mar 30, 2011

I've gone fully gray trying to learn how to do something in AS3 that was routine in AS2: Unloading (if something's already there) something from a movie clip then loading something in the same clip, all with the same button. Here's the code I'm using, er, attempting to use now. These are for two buttons out of a set of 9. All I'm trying to do is the simple: look to see if there's something in the clip "hovercap", and if so, remove it completely;, then load a new movie. (If there ISN'T something in "hovercap", I want to load a new movie anyway.

invisible_mvp1800c.addEventListener(MouseEvent.MOU SE_DOWN, loadImage); {
function loadImage(url:String):void {
if(imageLoader != null && contains(imageLoader)){
removeChild(imageLoader);
[Code] .....
Clearly, I'm still learning things in AS 3.

View 14 Replies

ActionScript 3.0 :: Close Window When Back Button Is Clicked On Movie Presentation

Jul 1, 2009

I have a .swf movie that is accessed through a link on a website. At the end of the movie are two buttons: one for "Back" and the other for "Replay." I have the buttons working so the Back button goes to the previous URL and the Replay button, well, replays. However, the Back button opens a new window. Is there a piece of Action Script 3 that I can add to the following to close the window in my .fla Action Script Window to close the window as it jumps to the URL? Here is the script.

[Code]...

View 2 Replies

ActionScript 2.0 :: Get Button To Play A Movie Clip (a Door Opening) And The Same Button To Close The Door

Sep 3, 2004

im trying to get 1 button to play a movie clip (a door opening) and the same button to close the door i know its possible and i think its by arrays

View 1 Replies

ActionScript 2.0 :: Get 1 Button To Play A Movie Clip (a Door Opening) And The Same Button To Close The Door?

Sep 3, 2004

im trying to get 1 button to play a movie clip (a door opening) and the same button to close the door i know its possible and i think its by arrays .

View 1 Replies

ActionScript 3.0 :: Button Code Doesn't Work?

Dec 19, 2010

I have a Rectangle Box called (Panel1_mc).And inside it there is a button called (BoardMessage1_btn). When I click on this button, the Rectange Panel should move upwards. Right now it is on the bottom of the page. The following code throws an 1010 error:

Panel1_mc.BoardMessage1_btn.addEventListener(Mouse Event.CLICK, clickSection);
function clickSection(evtObj:MouseEvent){
var Panel1Tween:TweenMax = new TweenMax(Panel1_mc, 6, {y:450, delay:1, ease:Strong.easeOut});
}

What is wrong with this code?

View 1 Replies

ActionScript 2.0 :: Code Does Not Work When Button Is Clicked To AttachMovie

Jul 5, 2004

I'm having some issues with my attach movie. I've made a button that attaches a movie when pressed.[code]My main loads this movie into an empty movie clip called "emptyMC". When I go to test the above code does not work when the button is clicked to attachMovie.I've tried switching _root to this and that didn't work, and I tried switching _root to _parent and that didn't work.What is the code for attaching a movie that is nested in an empty MC in my main movie.

View 7 Replies

ActionScript 2.0 :: RollOut Code Doesn't Work For Button?

Dec 5, 2006

why this wont work?

here is my code:

Code:
on(rollOver){
_root.tabmenu.butt_effects.services_button.gotoAndPlay(2);
}

[Code].....

View 2 Replies

ActionScript 3.0 :: Unload The Previous Loaded .swf And Load The New .swf Without Having A Separate Button To Unload

Aug 9, 2008

I am working on a school project that requires me to load external .swf or .jpg files. I currently have all of the buttons working and are loading an external .swf file on to the screen. The problem I am having is that when I go from one button to the next the loaded .swf stays on the screen and the next .swf gets loaded on top of it. I know that I need to unload the file but I am not sure where to put the code for the unload or what code exactly to use. I would like when the button is pressed to unload the previous loaded .swf and load the new .swf without having a separate button to unload.

[Code]...

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved