Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Can't Unload Already Opened .swf From Newly Opened .swf



I am not so good with actionscript, .....trying to learn unloading external files. I have 6 movies Mainmovie1.swffirst3buttons.swf bio.swf, history.swf, contact.swf, newmenu.swf first3buttons.swf loads atop Mainmovie.swf First3buttons.swf contains only 3 buttons(bio, history, contact) and movieclips holder(biomc, historymc, contactmc, newmenumc) for each of these external files ....So when i click bio from first3buttons.swf it should show bio.swf and also newmenu.swf. upto here everything works perfectly. But now I wanna use the menus from newmenu.swf, which is basically same like the first3buttons.swf , but in different shapes and colors. So within newmenu.swf I have again created 3 Movie clips (mcbio, mchistory, mccontact) for bio.swf, history.swf and contact.swf. And when i click one of the buttons it opens the corresponding file, but within this newmenu.swf. Which means the new opened file is under the earlier opened bio.swf. And I can't seem to figure out how to unload or remove the already opened external files. from the newmenu.swf I've given the following script to open files on (release) {loadMovie ("contact.swf", "mccontact");}on (release) {unloadMovie ("bio1");}this works only if the "bio1" is a movieclip inside newmenu.swf . but in this case it was inside first3buttons.swf, then I've tried the following code ,but without any result. on (release) {_root.first3buttonsmc.unloadMovie("first3buttons.s wf")} what am I missing here? Any help or suggestions would be greatly appreciated, ThanksKeul



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 08-04-2005, 05:42 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Can't Unload Already Opened .swf From Newly Opened .swf
I am not so good with actionscript, but trying to learn unloading external files.

I have 6 movies

Mainmovie1.swf
first3buttons.swf
bio.swf, history.swf, contact.swf, newmenu.swf

first3buttons.swf loads atop Mainmovie.swf

First3buttons.swf contains only 3 buttons(bio, history, contact) and movieclips holder(biomc, historymc, contactmc, newmenumc) for each of these external files ....So when i click bio from first3buttons.swf it should show bio.swf and also newmenu.swf. upto here everything works perfectly. But now I wanna use the menus from newmenu.swf, which is basically same like the first3buttons.swf , but in different shapes and colors. So within newmenu.swf I have again created 3 Movie clips (mcbio, mchistory, mccontact) for bio.swf, history.swf and contact.swf. And when i click one of the buttons it opens the corresponding file, but within this newmenu.swf. Which means the new opened file is under the earlier opened bio.swf. And I can't seem to figure out how to unload or remove the already opened external files.

from the newmenu.swf I've given the following script to open files

on (release) {
loadMovie ("contact.swf", "mccontact");
}
on (release) {
unloadMovie ("bio1");
}
this works only if the "bio1" is a movieclip inside newmenu.swf . but in this case it was inside first3buttons.swf,

then I've tried the following code ,but without any result.

on (release) {
_root.first3buttonsmc.unloadMovie("first3buttons.s wf")
}

what am I missing here? Any help or suggestions would be greatly appreciated,

Thanks
Keul

How Do I Focus A Newly Opened Page Opened Through Main Flash Page.
This is the script in my flash file. I would like for it to open the new html window with the size as stated but also bring it to focus in front of all other windows and I cannot seem to find the correct script or know where to put it correctly in this existing script.

on (release) {

sUrl = "Content/Makers/Dadslide1/VDM.html";
wdth = "500";
hdth = "462";
lft = 500;
tp = 10;
getURL("javascript:window.open('"+sUrl+"','yourpag e','width="+wdth+",height="+hdth+",top="+tp+",left ="+lft+
",directories=no,location=no,menubar=no,resizable= no,status=no,toolbar=yes,scrollbars=no'); void(0);")



gotoAndPlay(1);
}


How do i make it to where this window and others will focus to the front when a new button is pressed inside the main flash swf. I am looking all over the place and keep seeing focus script and none of it seems to be working.

Please help and thank you in advanced to those who do.

Do All .swf's Autoplay When Opened?
im using flash4 and i made a presentation and i dont want it to play as soon as it is opened. i'd much rather have the customer press "play" when they are ready.

any way of doing this?

How Do I Set The .swf To Take Up The Whole Window It's Opened In?
I tried just linking directly to the .swf but it gave me these white borders on the left and right of my bad .swf. What ever shalst one do?

[CS3] Swf Opened From Another Swf Using Loadmovie
I currently have a swf loading from another swf using loadmovie with a mc. My issue is in any web browser once the 2nd swf is loaded the original swf moves from the middle of the screen to the top left of the browser window. What I'd like to happen is the original swf that was loaded initially to stay in place, and have the new swf load on top of it.

Just something I'm fooling around with, nothing major, I'm just playing around with it as a hobby basically to learn how to make things work.

Here is an example of what I have so far
http://www.mikerigamer.com/test/msrgallerytest.swf

Any ideas?

FLA File Can't Be Opened
Hi

I use Macromedia Flash 8 Professional. I created a menu for my website. The problem is that when I close the program and open the file again to edit it or continue my work, I notice that some of the Graphics and Movie Clips are replaced by some of the other Graphics and Movie Clips. Well.. that's the smaller problem, the bigger one is that for some reason the program started to refuse opening the file. It shows the following message when I try to open the file:

error massage

Is this a bug in the program? or is it the FLA file? Can anyone help me, please?

Regards





























Edited: 02/18/2007 at 01:41:06 PM by M02A

How To Go To A Marker With A New Opened Swf?
hi there,

I have a question, if I want to go to a marker of a new swf, how do code it in actionscript? so that after I click a flash button, it will open a new flash, and a particular marker within the new flash. hope this time I made it clear, thanks very much in advance.

I tried, but doesn't work....
getURL("xxx.html"); <---- content a flash flash
gotoAndPlay("space"); <------ a marker I want to go

Center On My Screen When Opened
Hi gang
I was wondering if any of you could let me know how I can code my flash movie to center itself vertically and horizontally on my screen when someone clicks on my flash file?

Thanks!

Window To Be Opened With Mouse Over?
HI,

I want to emulate a link in HTML.

When u mouse over a link on an HTML page, it shows on the bottom of the browser window, where that link will take you.

Is it possible for a Flash button to do the same thing?
i.e when u mouse ova a Flash button, the link appears on the bottom of the browser window.

If this can be done, it would be great, if not, nevermind.

Cheerz,
Dwayne

Getting Rid Of Scrollbars On Opened Window
Hi, I have a button in the movie that opens up a new window to display pics
on (release) {
getURL ("javascript:window.open('http://www.spotculture.com/stairway75.jpg','Photography','width=375,height=60 0'), border=0, margin=0;void(0)");
}
I made the window size the same as the picture, but the scroll bar width and height seems to be included
how do I make it so there is no scroll bar?
thanks!

I Need Page Opened In New Window
first off i have never taken a computer or graphics class i just like this stuff and have been trying to learn flash by working on this site. a couple pages are php ie; the gallery and i'd like to have those open in a new window so people won't have to navigate back to the website. is there some additional code that i can add to the buttons action that will do this?

see it here!

btw: everything flash i learned on this site, thanks!

If Mc Is Opened, Close And Reopen?
Hi,

I know it's easy, but my actionscript knowledge is not enough to handle this...

on(release){
if(_root.mc2.power==0){
_root.mc2.endW=640;
_root.mc2.endH=120;
_root.mc2.power=1;

}
else if(_root.mc2.power==1){
_root.mc2.endW=0;
_root.mc2.endH=0;
_root.mc2.power=0;
}
}

with the code above... when the button clicked, mc turns on. if it's clicked once again(as in when the mc is already on) it gets closed. just on this point, i need it to reopen immediately. Can anyone complete this thing?

Thanks.

Need .fla Opened And Saved As Flash8
Someone has sent me flash file but I can't open it in flash 8. Please could someone with flash cs3 open this and save it as a flash8 .fla. and attach it to a post.

Thanks

Eugene

How To Centralise A Opened Swf File?
Hi,

I have an application created in flash MX. When I click on a button, the opened swf file is not appear in the center of the screen, instead it is appear at the top left corner. So what should I do to centralise the opened swf file?

Any help is appreciated.
Thanks in advance.

Making One Pop-up Close When Another Is Opened.
I'm working on an application that shows enlarged bits of text when their smaller counterparts are clicked. The problem I'm currently having is that I need to make all of the other open pop-ups close when a new one is opened. I considered adding an invisible box the size of the stage to each movie clip, but that would be unbelievably messy, so I'm trying to avoid that solution. The app in it's current state is here:

http://indigotest.com/flash.html

Please let me know if you have any ideas for a solution.

Checking If My Popup Has Opened.
I've got a bit of code that opens a popup, then tries to send info to it using localConnection. It's not working, is it because it's sending the connection too early? How can I make it check that the window is open before I send it?


ActionScript Code:
//Open PopupgetURL  ("javascript:var myWin; if(!myWin || myWin.closed){myWin = window.open('" +  winURL  +  "','"  +  winName  +  "','"  +  "width="  +  winWidth  +  ",height="  +  winHeight  +  ",toolbar="  +  winToolbar  +  ",location="  +  winLocation  +  ",directories="  +  winDirectories  +  ",status="  +  winStatus  +  ",menubar="  +  winMenuBar  +  ",scrollbars="  +  winScrollbars  +  ",resizable="  +  winResizable  +  ",top='+((screen.height/2)-("  +  h/2  +  "))+',left='+((screen.width/2)-("  +  w/2  +  "))+'"  +  "')}else{myWin.focus();};void(0);");//Send the picture infosendPictureInfo = new LocalConnection();sendPictureInfo.send("pictureInfoConnection", "pictureInfoFunction", "Ben rules ok!");

MoiDev Opened This Week
Hello there coders,
MoiDev is an API for creating games and applications for the players of MoiPal,
playing with their characters at whatever game you choose to make.
MoiDev gives you access to the character graphics and player stats,
with which one can choose to make any type of game.
Targeted for the hobbyist or beginner developer who would like to
test their hand at making a game for a ready user group.
Examples are provided for Java and J2ME, Flash and FlashLite.

Finished games will be listed to users from our main site.

Dev Site and Dev Forums: http://moidev.net/

Main Game Site: http://moipal.com/

Why Do Flash Movies Appear So Large When Opened On Their Own?
Hi,

There is probably a really simple answer to this, so any reponse would be much appreciated

On certain sites you see flash movies which appear within a certain part of the scree, ie. a logo positioned on the top right. As part of the web page these movies appear small and compact.

However, when you surf to the movie itself (ie. the location of the movie on the server), they appear huge and take up most of the screen!

How does this work? and why do the movies appear so small as part of the web page when in reality they are huge.

Thanks,

Chris

Powerpoint - SWF - Music Starts When Opened
Need help - added swf file into powerpoint using vb controls. swf runs fine, but when I start the powerpoint presentation the sxf music runs - I have not reached the slide the swf file is embeded. What gives ? Any help appreciated.

Shifting Background Position When Opened Again
the background of my site has a design which i would like to have shift to a different position each time someone enters the site. is this possible?

thanks.

Script To Auto-close A Mc When Another One Is Opened...
Hey,

In my site I got buttons which when pressed open a MC, which displays the content. In the MC it has 3 parts, a animation to enter the MC, the content shows, then a animation to close it, It has a lil X on each mc to close them.

Problem is when you click another MC it shows up on top of the old one unless you close it your self. I'd like to know if there is a script I can add to all my buttons so if one of them is hit, it automatically plays the other MC so it shows the animation of it leaving, before it opens the new one?

Ian

Centering Exe Fileson Screen When Opened
hello

i want to know how you can center a movie when opened, and size it at a specfic width and height.

thanks

Can U Define Size Of A New Win Opened With GetUrl?
I want to open a few movies in new windows with getUrl("x.mpg",1) call. Is it possible to define the properties of a such a window: size (most of all), color , center on screen?

Thanks

How To Centralise An Opened Swf File On The Screen?
Hi,

I have an application created in flash MX. When I click on a button, the opened swf file is not appear in the center of the screen, instead it is appear at the top left corner. So what should I do to centralise the opened swf file?

Any help is appreciated.
Thanks in advance.

Flash File Is Not Opened (urgent)
hello viewers,
this is santosh. i want to create preloader animation. i total design animation but i dont put preloader so please tell me sir how to put preloader or please give one sample file for preloader. i search in flashkit i download some preloaders but it is not opened in my flash mx professional so please help me any body urgent.
i already design one preloader but it is not opened. i put that file.

regards,
k.n.v

[CS3] CS3 Shuts Down When Actions Panel Is Opened
(CS3 - actionscript 3)
Hi,
I created a document with several layers, each with motion tweens. When I try to add an action to one of the layers by adding an actions layer then trying to open the actions window to write an action, the program shuts down. The moment I click 'Actions' in the menu, it shuts down instead of opening the window.
I thought I'd just copy all the layers and paste them into a new file in case there was a glitch in the old file, but I can't figure out how to do that either. It just pastes the image showing on the stage instead of the layers.
I can't seem to find the right info to resolve this in the help files or adobe's site.
Please help, thanks

Flash Movie Plays In WMP When Opened In IE.
Hi Everyone!

I made a small mp3 player using Flash 8. For most browsers, things seem to work fine when it's embedded into a page, but in Internet Explorer the movie appears within Windows Media Player!

You can see the embedded player at http://www.paulherron.net/personalpo...myspaceplayer/

I used the following code to embed what you see there:


HTML Code:
<object width="295" height="51">
<param name="movie" value="http://www.paulherron.net/personalportfolio/myspaceplayer/myspaceplayer.swf?filelocation=http://www.paulherron.net/personalportfolio/myspaceplayer/file.mp3">
<embed src="http://www.paulherron.net/personalportfolio/myspaceplayer/myspaceplayer.swf?filelocation=http://www.paulherron.net/personalportfolio/myspaceplayer/file.mp3" width="295" height="51">
</embed>
</object>
This code passes the variable 'filelocation' into the root of the movie, telling the player where to download the song from.

I've tried this on a few different systems, and the result is the same. I used IE 6, WMP 10, Firefox 1.5 and Opera 8.51 to test this out.

If you'd like to check out the player code, the .fla file is available for download on that page. Almost all of the code is in the 'Actions' layer on the first frame of the main timeline.

I'd really appreciate anyone's help on this. Thanks!

Detecting Focus When A New Window Has Been Opened
Hi gang,

Here's my issue, hope there's a solution. I have a flash movie that opens a new browser window. I want something to happen in flash when this new window is closed and focus is sent back to the main window.

I've set up a mc in flash to detect a variable that JavaScript will send in, but I'm having trouble detecting focus. Any help with this? thanks.

FLA File Can't Be Opened (JavaScript Error)
Hi

I use Macromedia Flash 8 Professional. I created a menu for my website. The problem is that when I close the program and open the file again to edit it or continue my work, I notice that some of the Graphics and Movie Clips are replaced by other some of the other Graphics and Movie Clips. Well.. that's the smaller problem, the bigger one is that for some reason the program started to refuse opening the file. It shows the following message when I try to open the file:



Is this a bug in the program? or is it the FLA file? Can anyone help me, please?

Regards

Closing A Window Opened By NavigateToUrl
Hi
I am trying to make AS3 run a server-side script in a php file on my server.
To do so, my ActionScript uses navigatToUrl("myPHPfile");
Once the script is done, I wish to close the opened window, and return to the movie.
If I use javascript to close my PHP file, it asks for permission from the user, and that's not an option for me.
Is there perhaps a way to close the window from the ActionScript, since that's how I opened it?
thanks
Joe

Music Plays Before Video Has Even Opened
Hello,

Ive been having trouble getting the sound track ive added to my video to wait until the actual file opens, before it plays (befor flash player has even opened physically) ive tried to add a loader and various AS's but to no evail. Any input on this would be great.

All the best. -2k-

Path For Mc In Component In Currently Opened .fla For A .swf Panel
some may know im building a hell-of-a-component... which basically types text....
i figured out how to get a movieclip to act as a cursor... but now that my list of options/attributes/settings or whatever you want to call them are so huge, i decided i really had to make a custom UI....
now ive done most of it now (hence the array.sort() question earlier - thanks sen! ) but i want to be able to preview what the current cursor is (if they choose to use a movieclip!)...

the path of the movieclip to be used as a cursor is, from within the component is: Typr.cursorMC
i tried using xch.Typr.cursorMC but that didnt work and ive no idea how i could link in with a currently open flash document... or if its even possible....

any help greatly appreciated....

one-liner help also greatly appreciated! lol

Prophet.

How To Centralise An Opened Swf File On The Screen?
Hi,

I have an application created in flash MX. When I click on a button, the opened swf file is not appear in the center of the screen, instead it is appear at the top left corner. So what should I do to centralise the opened swf file?

Any help is appreciated.
Thanks in advance.

Sliding Menu Tutorial ZIP CANNOT Be Opened
Hi everyone,

I'm trying to create the Sliding Menu by Kirupa but once I extracted the zip and try to open the .fla it says: "Unexpected file format". I'm using MX 2004 which should work! Can anyone tell me why it's doing that?

Because I still tried creating my own menu since he said that the .fla only contained the buttons, however my stage wouldn't let me place objects further than 1000px. So I was wondering also how can I change that property.

Thx! ^__^

Browse And Select An Image To Be Opened
Is it possible to browse and select an image from a persons computer and then display it using AS3?

Thanks in advance

~squirt

Passing Parameters To An Opened Page Help
Does anyone knows how can I click on a button, open a site page using the same browser instance(_blank) and pass some paratemeters to the swf on the new opened page? And how do I get those paramenters with the new page?

Thanks.

Path For Mc In Component In Currently Opened .fla For A .swf Panel
some may know im building a hell-of-a-component... which basically types text....
i figured out how to get a movieclip to act as a cursor... but now that my list of options/attributes/settings or whatever you want to call them are so huge, i decided i really had to make a custom UI....
now ive done most of it now (hence the array.sort() question earlier - thanks sen! ) but i want to be able to preview what the current cursor is (if they choose to use a movieclip!)...

the path of the movieclip to be used as a cursor is, from within the component is: Typr.cursorMC
i tried using xch.Typr.cursorMC but that didnt work and ive no idea how i could link in with a currently open flash document... or if its even possible....

any help greatly appreciated....

one-liner help also greatly appreciated! lol

Prophet.

Animation Loading URL Only When Opened Locally
Hi,

Being a programmer (and not a Flash designer), I'm having what seems to me like a strange problem with a Flash animation provided by a designer. The animation is supposed to fetch text from an URL, and load it as variables into the animation. An excerpt of the actionscript that does this, looks like this:


Code:
loadVarsText = new LoadVars();
loadVarsText.load("http://www.nafo.info/index.php/layout/set/none/content/view/full/73");

loadVarsText.onLoad = function(success) {

if (success) {

trace("done loading");

menu.om.descr = this.ANSATTETEKST;

popup.tekst.htmlText = this.ANSATTETEKST;

} else {

trace("not loaded");

}

};


When the animation is opened locally, the text from the URL appears where it should. However, when I upload the animation to the server, the text is gone.

Any idea why? Thanks in advance !

Flash Movie Plays In WMP When Opened In IE.
Hi Everyone!

I made a small mp3 player using Flash 8. For most browsers, things seem to work fine when it's embedded into a page, but in Internet Explorer the movie appears within Windows Media Player!

You can see the embedded player at http://www.paulherron.net/personalpo...myspaceplayer/

I used the following code to embed what you see there:


HTML Code:
<object width="295" height="51">
<param name="movie" value="http://www.paulherron.net/personalportfolio/myspaceplayer/myspaceplayer.swf?filelocation=http://www.paulherron.net/personalportfolio/myspaceplayer/file.mp3">
<embed src="http://www.paulherron.net/personalportfolio/myspaceplayer/myspaceplayer.swf?filelocation=http://www.paulherron.net/personalportfolio/myspaceplayer/file.mp3" width="295" height="51">
</embed>
</object>
This code passes the variable 'filelocation' into the root of the movie, telling the player where to download the song from.

I've tried this on a few different systems, and the result is the same. I used IE 6, WMP 10, Firefox 1.5 and Opera 8.51 to test this out.

If you'd like to check out the player code, the .fla file is available for download on that page. Almost all of the code is in the 'Actions' layer on the first frame of the main timeline.

I'd really appreciate anyone's help on this. Thanks!

Flash Movie Is Choppy When Opened
Hey guys,

Just need a little advice.  I have created a countdown timer which reads in a specified date and message then counts down to that date.  The problem is that it hangs for a second when it is opened.  This is especially noticeable if the .swf file is displayed in a webpage (locally).  The .swf file itself is only 2kb so I can't see what the problem is.

I have uploaded the file to http://users.tpg.com.au/jakeadam/countdown1.zip

If you have a spare minute and can help me out I would really appreciate it.  I have never used Flash before, so I have probably made some critical errors.  Coming from a VB.NET background I am finding the transition very different.

Thanks heaps,
Adam




------------------------------------
There's no place like 127.0.0.1
------------------------------------


Flash Movie Plays In WMP When Opened In IE.
Hi Everyone!

I made a small mp3 player using Flash 8. For most browsers, things seem to work fine when it's embedded into a page, but in Internet Explorer the movie appears within Windows Media Player!

You can see the embedded player at http://www.paulherron.net/personalportfolio/myspaceplayer/

I used the following code to embed what you see there:

CODE<object width="295" height="51">
<param name="movie" value="http://www.paulherron.net/personalportfolio/myspaceplayer/myspaceplayer.swf?filelocation=http://www.paulherron.net/personalportfolio/myspaceplayer/file.mp3">
<embed src="http://www.paulherron.net/personalportfolio/myspaceplayer/myspaceplayer.swf?filelocation=http://www.paulherron.net/personalportfolio/myspaceplayer/file.mp3" width="295" height="51">
</embed>
</object>

GetURL Then Focus Opened Window?
From an exe I'm launching an html page with getURL. The problem is the page opens behind the presentation but I need it to be focused.

Any suggestions? Thanks.

Animation Starts When Page Is Opened
well am looking for a script thru which an animation starts when the page is opened.. ie when the page is on focus..like say i have a website which has flash presentation in it , a user have opened it but has minimised the page...the animation only starts when the page is maximised.

Using Javascript To Close A Previous Opened Popup
how can i close a previous opened popup using javascript from swf? I explain my problem. I have a popup window that i open with streaming audio when i press a button in the intro page. Then, in another page, with a button start another streaming. So i want to close that popup that play music in background because i don't wanna two kind of music play at the same time. So how i resolve that ?

Is There A Way To Re-size The Windows That Open When Flash Is Opened?
I being trying to find a way, but i cant......

and if u dont mind, i have being importing file (pictures) to use in my project, but when i do so the picture look bigger and quality is lost... is there a way to prevent this? thank you

Closing And Html Window That Was Opened From Flash
I am using this code to open an HTML window from flash

on (release) {
getURL ("taps.htm", "_blank");
}

When I use window.close() as a button on the HTML page it comes up with a message box asking "are you sure you want to close this page"
Is there any way to get rid of this message?

Protect Your SWF From Being Opened On Action Script Viewer (This Regards Anyone Here)
Hello there!

There was a little trick code to put on your scripts to protect a person from opening your SWF file (with "Action Script Viewer 2.0") and viewing/stealing all your hard work on the scripts you've made.

The little code was this:

Code:
void 0(!0);
If a user tried to open in "Action Script Viewer 2.0" your SWF with that code, the program would popup a window if an error.
Perfect! The can't see your code!!!

Now the bad part:
The makers of "Action Script Viewer" made a new version of this program (version: 2.5) which totally ignores void 0(!0) trick to protect your code, and it shows ALL of SWF file as if they have your FLA file!!!!!!!!!!!!!

Is there any new way to protect SWF files for the version 2.5 now??

BASIC: Reusing Opened HTML Windows
Hi,

I've got a flash based thumbnailed gallery, and the full size pops up in another window. ANways, after viewing a few pictures the user's desktop is cluttered with a lot of opened windows...

so, how do i reuse an opened popup window???? in plain html, it's just a matter of calling the same HTML name.. but it aint working in flash's getURL func..

please advice

Swf Works When Tested From Flash But Not When Opened On Desktop
i have this flash file that when i test the movie on flash it works... but when i try to open it from my desktop it doesnt work...
any ideas why?

Copyright © 2005-08 www.BigResource.com, All rights reserved