ActionScript 3.0 :: Button To Navigate And Unload Swf?
Apr 28, 2011
I have the following code to load an external swf by clicking a button. It works fine.
btn_01_01.addEventListener(MouseEvent.CLICK, fl_ClickToLoadUnloadSWF);
function fl_ClickToLoadUnloadSWF(event:MouseEvent):void
{
var url:String = event.currentTarget.name+".swf";
[Code].....
But the loaded swf is still visible.
I would like that button to also unload the loaded swf.
View 12 Replies
Similar Posts:
Sep 16, 2010
I have a flash page where I am loading another .swf into. With a button in the loaded swf I need to unload the loaded swf (where the button is) and navigate to a specific frame label in the parent .swf. I've tried to do the following in the key frame where the swf get loaded into I've put the following:
var gallery_load_wonderland:Loader = new Loader();
gallery_load_wonderland.contentLoaderInfo.addEventListener(ProgressEve nt.PROGRESS, loop_wonderland);
gallery_load_wonderland.contentLoaderInfo.addEventListener(Event.COMPL ETE, done_wonderland);
gallery_load_wonderland.load(new URLRequest("gallery_wonderland.swf"));
function loop_wonderland(e:ProgressEvent):void {
[Code] .....
I basically want to first load the swf called "gallery_wonderland.swf". Then in the "gallery_wonderland.swf" there's a button called "contact03_btn" which I want to unload "gallery_wonderland.swf" even though it's inside the swf and navigate to the frame label called "Contact" in the parent swf.
What can I do I've done similar before and it works, but when I do it know and I click the contact03_btn it comes with following error message:
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Stage@26215ba1 to flash.display.MovieClip.
at gallery_wonderland_fla::MainTimeline/back_wonderland()[gallery_wonder land_fla.MainTimeline::frame1:227]
View 13 Replies
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
Feb 14, 2009
Ok I have create several buttons to navigate to other urls, and one of them is working but the other 3 I have are not working. All I did was copy over the code and change the differences between the two. I don't get any errors or anything but when I click on them nothing happens...
var myspaceSite:URLRequest = new URLRequest("http://www.myspace.com/thehangoutinfo");
myspaceBtn.addEventListener(MouseEvent.CLICK, goMyspace);
function goMyspace(e:Event){
navigateToURL(myspaceSite);
}
View 5 Replies
Feb 25, 2004
I have a Button within a movieclip. The movieclip does a show/hide function when a button is pressed. The button simply contains:
on (release) {
gotoAndStop("contact", 1);
}
However, this button action does not function.
View 2 Replies
Feb 25, 2004
I have a Button within a movieclip. The movieclip does a show/hide function when a button is pressed. the button simply contains:
on (release) {
gotoAndStop("contact", 1);
}
However, this button action does not function.
View 2 Replies
Jul 20, 2010
I am trying to use around 10 swfs. I want to navigate one SWF to other using a button click. Have any method to reuse already loaded swf again? the best way for the swf transitions (navigation). Now I am using following code.
[Code]....
View 4 Replies
Nov 6, 2009
I have 2 buttons on the root of the flash, i want use those buttons to control the frames of a movie clip, how can it be done?
View 2 Replies
Jul 16, 2009
This is the code I am using:
main_btn.addEventListener(MouseEvent.CLICK, onMouseClick);
function onMouseClick(e:MouseEvent):[code]...
When I click on the button, it does nothing but sit there with a blank stare like I did in physics class. It works fine if I switch it to _blank, but that is totally not what I want. Why is this not working?
View 3 Replies
Oct 31, 2008
I am having serious problems with creating a simple navigate to URL in Flash CS3. The code I have is:
[Code]...
I have put this in the first timeline in my movie. When I "check syntax" everything seems great. But when I publish as AS3 I recieve the following error:
[Code]...
View 7 Replies
Mar 20, 2010
I'm using AS3 in timeline. I have an input text box and a button. I would like to navigate to scenes using passwords and a submit button. On timeline I have four labels: intro_1 to intro_4. The input text box is called main_sections. The submit button is called main_btn. Both text box and button are on a layer that goes from intro_1 to intro_4. PROBLEM The only scene I can go without errors is section_4. All other scenes show error
[Code]....
View 1 Replies
May 20, 2005
It works with a movieholder and the loadMovie command. It has 9 buttons, one for each picture, and they work. There's also a previous and next button to navigate through the pictures, there the loadMovie command gives problems. Here are 2 lines that are used in the previous button:
[Code]...
View 5 Replies
Jan 12, 2012
on release of the button, how do I navigate to a completely different movie clip? so I know about _parent and _root in terms of moving between layers but say I wanted the press of a button to gotoAndStop(2); inside a different movie clip that is not parented or on the _root?
View 2 Replies
Jul 18, 2009
My question is, Is there a way to highlight and active button when i navigate to different page on my site?Home - highlighted when on the homepage
View 1 Replies
Sep 7, 2011
I have a swf that I'd like to navigate with keyboard arrows to access each active button.
(a) navigating through 'hit state' buttons on a menu page using arrow keys
(b) a highlight_mc that remains on the focus item.In the same swf I also have key press methods in place.
I feel like this is an easy issue, but maybe some input form a PRO could unlodge my thinking.
View 3 Replies
Jan 17, 2010
I am trying to create a little website in flash.. I have some video that plays automatically once the user goes to that section (I am using frame labels to navigate from section to section of the site). But, when the user clicks another button to go to a different page, the video is still playing because I hear it..How can I stop the video from playing once another button gets clicked?
View 20 Replies
Jan 21, 2010
I've been having a bit of a hard time understanding how to get a button which I have created in Flash to navigate to the next slide of the PowerPoint presentation which it has been added into.
I understand that I somehow need to make use of fscommand in ActionScript, but I'm not sure how I can get Flash and PowerPoint to communicate between themselves.
I'm using Flash MX 2004 7.0 and Powerpoint 2003.
View 1 Replies
Feb 16, 2003
The code that u have recommended is not working properly... What i meant is that the function of the back button is to navigate where the users has last viewed the webpages..
View 1 Replies
Apr 24, 2003
how to unload a mc with this
on (release) {
loadMovie ("button.swf",_root.dropzone);
{
how to unload the button.swf
View 3 Replies
Jan 16, 2010
i have a menu, that works with a xml file.the xml has the specific code that triggers the .as file:
HTML Code:
<buttons>
<button name="HOME" linkType="custom" link="home.swf" />
[code].....
View 5 Replies
Jan 21, 2010
I created a flash site and on the gallery page I load a gallery .swf and I want to be able to click on the "about" and "contact" buttons and have it go to there page and unload the gallery swf. This is the code I have on the gallery frame
import flash.net.URLRequest;
import flash.display.Loader;
import flash.events.Event;
import flash.events.ProgressEvent;
function startLoad(){
var mLoader:Loader = new Loader();
[Code] .....
View 1 Replies
May 23, 2010
I use the following code to load a swf on top of main. Is there a way to have a button in the loaded swf then close the loaded swf?
[Code]...
View 5 Replies
Nov 30, 2010
im using the [code]function to load files into my fla .im trying to put a button in each of the loaded swf files that will tell the main fla to unload the swf and gotoAndStop(1)i have 3 buttons on the first frame of main fla. the first button has [code] different game.so i need a button to unload the game and gotoAndPlay(1) i know how to do this in as3 but im not to familiar with as2.
View 1 Replies
Mar 15, 2011
Everything works perfect except for one problem I just can't figure out. On the homepage, called "home_page_swf", I have three buttons at the end of three paragraphs that say "Learn More" and need them to trigger the "home_page_swf" to unload itself and replace it with one of the other external swf pages. I basically want the three buttons within the "home_page_swf" to perform the same function as the "Services", "Portfolio", and "Team" buttons that are located in main swf. I've been trying to read up on it and I keep finding something about "Dispatch Even" but can't figure out how to apply it to the code I am using for the website I'm working on. I'll post the code below for the main navigation swf and what the labels are for the buttons that are inside the external swf called "home_page_swf".
Main SWF with main navigation buttons:
var Xpos:Number = 0.0;
var Ypos:Number = 0.0;
[code]....
View 1 Replies
Mar 31, 2011
I have a button and i am trying to unload it but i dont know how.
I add the child as follows : addChild(buttons);
I try to remove it by : removeChild(buttons);
but this does not work, nothing happens.
View 2 Replies
Feb 8, 2011
I trying to unload swf then load swf with 1 button it does not work, how i make it work i need it to reload each time i click button.
[Code].....
View 3 Replies
May 31, 2011
For a project, I have a main page that for each button loads a swf page, that contains a photo gallery, now, for each of these pages, I want a main button, that can return the user to the main page to select another gallery, I have gotten it to work, but it doesn't really stop the gallery, and judging by my memory usage, it seems that it is still running in the background. For the main page's buttons, [code]...
View 3 Replies
Jun 22, 2009
I have 3 nav btn and each btn load an external swf successfully. My problems is it doesn't unload. I have tried adding pageLoader.unload(page) and mcContainer.removeChild(pageLoader) but it doesn't work. The code below contains load external swf only.What is the best way of unload a swf using as3?
var mcContainer:MovieClip;
var pageLoader:Loader = new Loader();
galleryBtn.addEventListener(MouseEvent.CLICK, galleryPage);
[code]....
View 2 Replies
Oct 12, 2006
I've got a Loader that imports picture files from the .fla's directory...buttons open the pictures up.I need to know a quick and easy way to unload the pictures with another button...the only requirement is that the 'close' button cannot be visable when no pictures are being shown.url...
View 1 Replies
May 29, 2009
I can load swf file from nav buttons. Gallery page is my default page. When I click about button I want gallery.swf to unload and about page to show up.Currently, gallery page is still in the background when I click about page.Gallery page is removed if I click about page again. How do I fix this?
var pageLoader:Loader = new Loader();
galleryBtn.addEventListener(MouseEvent.CLICK, galleryPage);
function galleryPage(e:MouseEvent):void {
[code].....
View 6 Replies