ActionScript 2.0 :: Removing External .swf File Once Youre Done With It?
Nov 9, 2009
I was trying to intergrate two game flash files that I created, by combining them into one file (on one timeline), but was having issues with making my timer stop...As the lesser of two evils (or so I thought) I decided to load one of the games into the other file on a particular button click as an external .swf. This solved the timing issue, but now.I dont know how to get rid of the .swf once im done playing it and ready to move on with the original game.I need some buttoncode (AS2) to remove .swf on button click.
ps. button code to load .swf looks like this...
on (release){
LoadMovieNum("racing_part1_me.swf",2)[code].....
View 1 Replies
Similar Posts:
Apr 21, 2009
I managed to load in an external swf file okay however, I need to be able to remove it when the user clicks a link to go back to the homepage. Below is my code:
Code: Select allstop();
var imageRequest:URLRequest = new URLRequest("gallery.swf");
var imageLoader:Loader = new Loader();
imageLoader.load(imageRequest);
addChild(imageLoader);
home_link_btn.addEventListener(MouseEvent.CLICK, homeLink);
[Code] .....
I assumed it was as simple as removing the child but it still remains. I get no compile errors or anything.
View 2 Replies
Feb 18, 2009
i have a main .fla file which i shall call projectthing.fla for example purposes, and on one of the frames in projectthing.fla i an nesting a movie clip called "childgalleryholder" which currently resides in my library. within this "mychildgalleryholder" i am... importing?... an external .swf which is located in the same folder as my main projectthing.fla . The .swf that i speak of is called stack_gallery.swf and essentially the same file that im using can be found here. Now then, to pull said .swf into the holder movieclip i mention above i am using this code:
ActionScript Code:
import flash.net.URLRequest;
import flash.display.Loader;[code]....
Now then, this all works fine (well good enough anyway), BUT when it comes to changing frames, no matter what frame i switch to, the holder mc DOES NOT go away, or at least i assume its the holder mc the point is that the imported .swf stays on the screen and renders my project unusable until i close it then reload it and avoid that frame.So i decided to set up a button which uses this code to remove the holder from the stage:
ActionScript Code:
removePhotoSlideShow.addEventListener(MouseEvent.MOUSE_DOWN, onClickremovePhotoSlideShow);
function onClickremovePhotoSlideShow(evt:MouseEvent):void{
removeChild(mychildgalleryholder);[code]....
It works fine and the thing goes away, BUT it leaves the photos in place for no apparent reason.
View 9 Replies
Feb 19, 2009
I have a extremely simple page that I am making... [URL] Upon going to the site you should get the same error that every one gets which is what is bugging me..
ActionScript Code:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
at mainbodyflash_fla::MainTimeline/frame2()
Basically, the "Gallery" section has an external SWF being loaded into it. I call it in by putting the following code onto Frame 1 of my actions layer...
ActionScript Code:
var myrequest:URLRequest=new
URLRequest("viewer.swf");
var myloader:Loader=new Loader ();
myloader.load(myrequest);
And I display it in the actually "Galley" stage by using this code on the content layer in the "gallery" frame...
ActionScript Code:
stage.addChild(myloader);
If I just leave it like this it loads fine and I don't get any errors.....but if you click on any of the other tabs the external swf overlaps what is in those parts.... so I tried to just use this code in those frames....
ActionScript Code:
stage.removeChild(myloader);
And it does make it so that it doesn't overlap anymore...but thats when I get that error mentioned above.... so basically I want to know how to remove the external SWF when going to another frame without it overlapping or giving me this error....
View 1 Replies
Mar 27, 2009
I'm trying to use various buttons for navigation on webpage. Having problems removing a swf that would have been added by a loader. The container mc can be removed but the swf added to it just stays. I read other topics on this subject but I don't understand where to put the removal events. If anyone has some typical code snippet....
Code:
// everything down through the imageLoaded() function works as it is suppossed to
addChild(blogNewsMC);
[code].....
View 2 Replies
May 20, 2008
I have a list of buttons that each load an external SWF when pressed. When a button is pressed, the SWF loads into a movieclip on the main timeline, and the list dissappears (so only one is loaded at a time). The main timeline moves to a frame with a back button. When the back button is pressed, I'm trying to remove the loaded SWF and make the menu visible again to load another SWF.This all works, but when I get back to the menu and try to load a new SWF, I get the error:TypeError: Error #1009: Cannot access a property or method of a null object reference.at CrystalBall/PL_LOADING()rystalBall being the first SWF I tried to load. The error fires like, four or five times too. I know it has something to do with the code trying to remove the loader before it loads it again, but I'm not sure how to fix it
Code:
package {
import flash.display.*;
[code].....
View 3 Replies
Oct 10, 2010
So I am loading an external swf clip into my project. When it finished playing, I want to remove it. How do I track when its finished playing?
View 4 Replies
Jan 2, 2012
I have a main_mc that loads and external xml slideshow on frame 1 via this code:
ActionScript Code:
stop();
import fl.transitions.Tween;
import fl.transitions.easing.*;
[Code].....
View 5 Replies
Feb 12, 2009
I have checked the forums for a solution but I cant seem to find anything that works quite like I need it to. Or maybe I just don't understand?
Code:
function BiographyExternal():void
{
var PageBios:URLRequest = new URLRequest("Biographies.swf");
[Code]....
This works when I want to add a movie clip, but what if I want to try and remove it? I need to check if it exists first right?
Basically in another function I want to check if this file is loaded and if it is, I want to remove it.
View 2 Replies
Feb 25, 2010
Here is what i am doing:maintimeline 1:frame 2 I have loaded 1 external swf A and 2 textfields.on 2nd timeline (which is on submenu navbar_mc) i am loading a different external swf and want to remove external swf A and textfields that are showing from the main timeline.[code]...
View 4 Replies
Apr 26, 2011
I am building a small quiz in flash, where the user gets a question and 3 answers, that is both shown in text and read as external sound (mp3). I am calling a function to show and read the next answers when the first answer has been read. The text is shown immidately but the sound takes around 6-7 secs. to load......(and it is only 60 kb) how can I avoid this?
My function looks something like this
function readAnswer(){
my_sound=new Sound();
my_sound.loadSound("answer1.mp3",true);
my_sound.onSoundComplete = function() {
trace("answer finish");
//next answer
_root.readAnswer();
}}
View 1 Replies
Nov 17, 2011
I want to gain knowledge outside of the class.I have 4 buttons that each load different external swf and load properly the probelm i have is i cant remove them. this is my trouble. I have tried the remove child but it cant be that easy and it doesnt work. i must be going wrong.when i go to remove one single child it remove the the latest child but wont remove every child that i want so the MC is clear and ready for the nest button to load the swf.heres my code so far.
Code:
import flash.events.MouseEvent;
import flash.media.SoundMixer;
[code].....
View 1 Replies
Apr 3, 2009
I have problem with removing dynamicly generated MovieClip in external class. How can I remove it? I'm getting this error:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.at flash.display::DisplayObjectContainer/removeChild() at SomeEffect/updateMc()
View 1 Replies
Nov 11, 2010
I have an SWF file which I water-marked.
and then, I thought of removing the watermark from the SWF file by modifying its raw data on disk.
And since SWF is an open standard, I've taken a look at SWF Flash Player 10 Specs from Adobe.
My watermark is a movieclip object which is loaded in the first frame. but till now I'm not able to remove it.
I am trying to inspect the tag (DefineSprite) which is coded in Hex as (3F 09) which is converted to (09 3F) because of the little endian.
Or there is a different approach, which is to remove the control tag (PlaceObject2) which I couldn't find in the same file HEX dump.
P.S: Yes, I've decompressed the file.
View 3 Replies
Nov 21, 2011
I have tried to put main.asc sample file on my live application, removed main.far file and restarted my FMS, after that, i couldn't use FMLE on it, it generates an error !how to put properly the main.asc on FMS 4 (it works good for FMS 3.5)
View 14 Replies
Jun 3, 2009
I have a large swf that is embedded in Director as a sprite I now want to put it onto a web page, so file size is critical Is there a way to remove unused library items when publishing so that file size is reduced? Is there another way to compress the swf so it is much smaller?The current size is about 25 Mb.What about streaming the swf?I'm not talking about streaming video or audio, just any Flash content.In Director, there is a way to right-click on a cast member and choose "find in score".If something isn't found it means that it either is not used in the movie or is implemented through code
View 3 Replies
Jun 3, 2009
I have a large swf that is embedded in Director as a sprite. I now want to put it onto a web page, so file size is critical. Is there a way to remove unused library items when publishing so that file size is reduced? Is there another way to compress the swf so it is much smaller? The current size is about 25 Mb. What about streaming the swf? I'm not talking about streaming video or audio, just any Flash content. Any tricks for speeding the process up so that the user doesn't have a long wait before the swf starts?In Director, there is a way to right-click on a cast member and choose "find in score". If something isn't found it means that it either is not used in the movie or is implemented through codeIs there a similar way in Flash of detecting unused items or automatically eliminating them when publishing?
View 1 Replies
Sep 12, 2009
I can't seem to remove / unload the external swf files e.g when the carousel.swf (portfolio) is displayed and I press the about button the about content is overlapping the carousel (portfolio) . How can I remove / unload an external swf file from the main flash file and load a new swf file, while at the same time removing garbage collection from memory?
View 15 Replies
Nov 9, 2005
How can I replace text loaded from an external file with text from another external file? Using setInterval and calling the .load from a function or something? In the example below I'm calling an external text file, could this also work with an .xml file with cycling through the children?
[Code]...
View 2 Replies
Apr 17, 2012
I am using in AS3 "External Interface ". When I call the JS function that is on the same page as swf everything works fine.
I added a link in the html page to an external JS file, when I move the JS function to the external JS file the website crushes.
I would prefer to have all my JS functions on an external file so I can use them in the future in other project and it also makes it easier for me to update the site.
how to call a JS function that is on an external file from AS3?
View 6 Replies
May 28, 2007
Structure: There is 1 main file that loads external SWF files depending on what is clicked on.One of the external SWF files loads its text from external text files. This works fine when viewing the SWF applet on its own. But when viewing as a whole site, the text doesnt appear. Very annoying.I made that particular SWF on my mums computer running Flash MX 2004The flash file itself uses the Scrollbar component from MX.Could someone tell me why the text doesnt load in this scenario? It runs fine on its own, just not as an external SWF.
View 4 Replies
Oct 20, 2009
I've re done a couple of pages on my website and as a result of the new design have had to change some of the coding from being on the timeline to being in an external as document linked to my fla. This is significant only because I can link to external pdf.zips no problem on the timeline but I can't seem to translate the code to the external file. Can anyone out there help me out with this (hopefully) simply problem?I'm playing with different variations of this below but I'm constantly getting the 1180: Call to a possibly undefined method navigateToURL.
function onEnglishClick(event:MouseEvent):void {
var request:URLRequest = new URLRequest("http://www.bigredcreativeconcepts.com/UB_Flyer_English.pdf.zip");
[code].....
View 1 Replies
Jul 27, 2011
i have banner with 5 images fad in fade out effecti need to load images & test from external file " text file or xml file " with keeping fade effects on imagesall ways i know can't keep fading effect on images so
View 4 Replies
Nov 17, 2004
I have a movie player that works fine when i hard-code the url value in the video function, but when i try to pass that url/file path from an external file, the video doesn't load. I suspect that there is something i'm doing wrong with the quotes. What am i doing wrong?
[Code]...
View 5 Replies
Jul 23, 2011
I do understand the differance between ssas and as3. Not all, but all most everything I see written in SSAS can be writen into a external AS3 file. This leads me to quite a few questions I'm hoping you kind people can shed some light on for me.
1) What is the advantage of writing a SSAS file over an external AS3 file?
2) Can I write an .asc file in AS3 or do I have to use AS1? Please understand I'm using tuts from fmsguru.com and the books "Learning Flash Media Server" (pdf) and "Programming Flash Communication Server". I'm not a javascript programmer so nothing I do in AS1 seems to make any sence while everything I do in AS3 does. It may not seem like it to you people that are programmers, but to those of us that aren't, AS1 and AS3 are miles apart.
3) kind of off topic, but a security question. I'm not a "hacker" and don't like the jerks that are. My question is on external AS / SSAS files and swf files. When my fla is compiled into a swf does my external AS files remain external? I assume they do, but then what is the threat of the swf being decompiled? In most projects I would do I could care less if somebody had access to my fla as long as they don't have my actionscript files.
I don't know. Maybe on questions one and two I'm getting confused becasue I'm using out dated material. Again I assume that even though fms was built off of the javascript engine it should be able to read and execute my AS3 file. Other wise what was the point of the evolution of actionscript into a fully functional programming language?
View 1 Replies
May 16, 2005
I turn to you for help, dear sweet Kirupa Forumites. First, let me explain the problem: I have a flash file reading an external text file for the content. Everything works perfectly for nearly everyone - you click a menu button, and the content text comes up fine. However, a couple of people have found that the text shows up as "undefined". I have checked the player versions of the people where it doesn't work, and it is the same as for those where it does work, so that ain't the problem.
I don't understand why it works perfectly for nearly everyone, but a small number of people have this "undefined" text problem. It seems to be a problem with loading the external text file, but I don't know why. I have a main flash movie, and load the text in the first frame, using the following:
var my_content = new LoadVars();
my_content.load("content.txt");
my_content.onLoad = function(success){
if (success){
[Code]...
I then have a couple of dynamic text boxes in the main movie - one called ErrorText (for displaying an error message to the user) and one called ContentText (for displaying the content). I use an external menu swf which jumps to a specific frame in the main movie, depending on which button is clicked. Actionscript on the main movie frame for the first button does the following, with the other frames similarly configured:
ContentText.htmlText = my_content.content1;
stop();
My external text file is properly configured (content1=blah blah&content2=other blah blah) etc.
Does anyone have any advice on how I can solve this particular weird problem??
View 3 Replies
Nov 20, 2009
All I'm trying to do is load an external .swf file into a precise location on the stage of my existing Flash file. I've spent an hour and a half on this site search and found nothing. What do I add to my loadMovie command to place the file at specific x,y coordinates?
View 3 Replies
Aug 17, 2011
i have a question. let say i have file1.swf , file2.swf, and file3.swf, how can i link this 3 files together,let say suppose file1.swf is the main content file, but as i load file2.swf, i want the file1.swf get replaced by file2.swf. How could i unload file1.swf at that time, so that my file2.swf will become the main content file?and again, when my current position at file2.swf, and i want it get replaced by file3.swf by clink on a button. so that the i can unload the file2.swf and let the file3.swf become the main content file.
View 13 Replies
Apr 21, 2008
I'm creating a flash 3d website for a company. The idea is that there is one overall swf file - this holds the navigation and design. Once the user clicks on a button, it goes to frame 10, I have included the following script to load a swf file
loadMovie("deepbartesting.swf", maincontent);
this.onEnterFrame=function(){
if(movieClipName._currentframe==5){
[Code]....
the preloader works, but instead of going to frame 2 of that swf file, it goes to frame 2 of the overall swf that holds the navigation. Does anyone know how to get around this so that it goes to frame 2 in the same swf file as the preloader?
View 1 Replies
Oct 5, 2009
I have a bunch of code inside my actions panel but I want to switch it to being in an AS file which would be external to the FLA file. I am looking for a tutorial or data on this. What terms do I search under?
View 6 Replies