ActionScript 3.0 :: Removing External Swf ?
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
Similar Posts:
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 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
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
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
Jan 18, 2010
I'm trying to get tables to display using flash. Currently I have two scenes, with a table on each scene. I have buttons that switch back and forth between the scenes and each table loads fine when I run each scene individually. The problem is I have no idea how to REMOVE a table from the scene. Currently when I play the whole movie the first table that loaded stays loaded, and the second table just loads over the top of it.
Also, I get an error #1009 after I switch back and forth from one scene to the other. So first table loads fine, click button, second table loads fine, click button, error #1009. I tried commenting out the table load parts on each scene and just leaving the button code and it worked fine. Then I left the first table load sequence commented out, and it loaded the second fine, click, loaded first page fine, click, loaded second table fine again (over the top), click, error #1009.
[Code]....
View 1 Replies
Aug 11, 2010
When I click a button "boardButton" at frame 30 it will load my ext. swf pretty fine. But when I click my button "sponsorButton" at frame 50(I've more buttons) I need to remove the external file, but it won't happen. The trace of removing shows up but the ext. swf is still there...... I tried lots of things but no luck at all (two evenings spent already and no hair left)
View 4 Replies
Jul 17, 2009
how to remove duplicate values from xml although it successfully done using array but not in xml
here's my xml data looks like (list.xml)
Code:
<?xml version="1.0" ?>
<gallery>
<menu maker="adobe1" software="flash"/>
<menu maker="adobe2" software="photoshop"/>
[Code].....
View 5 Replies
Nov 3, 2009
What i am trying to do is when i click on a part of an img to delete it.[code]i read on setpixels and getpixels but this did ot help.
View 2 Replies
Dec 15, 2009
I have a main. fla with navigation btns activated by GoToFrame actions. Some btns load content and some use the UI loader component.
I have one btn that calls a UI loader "loaderVideoGallery" which loads an external .swf inside that .swf is an flv player "flvPlayer".
This also works fine except after that button is selected and that swf is on stage no matter what button you call next the video stream from the flv does not stop, it continues to play.
The UI loader removes itself as you can see the other loaders come up on button presses but the video's audio still plays.
the UI Loader instance is "loaderVideoGallery" and the .flv player inside the external .swf is flvPlayer
I was told to use
MovieClip(loaderVideoGallery.content).flvPlayer.st op()
I would think that the logical place to put this code would be inside the btns where the EventListeners are, is that correct?
View 5 Replies
Feb 18, 2010
I have been searching all over about removing embedded swf but couldn't find any solution.Here is my scenario
Code:
[Embed(source="hero.swf")]
var Hero:Class;
[code].....
View 1 Replies
Sep 26, 2011
URL...when you click on a picture on the home page, a bigger image shows on, when u scroll over it a black box slides out from the side. how do i prevent that from sliding when you scroll over the picture?I am using a pre-made template.
View 8 Replies
Feb 2, 2009
Im using the following code to create a mc from a template iv made stored in the library:
var galleryThumbs:MovieClip = new contentTemplate();
galleryThumbs.x = 710;
galleryThumbs.name = "galleryThumbs";[code].........
that all works fine but then im trying to remove it with this, with no success:
if (galleryBox){
removeChild(galleryThumbs);
}
View 6 Replies
Sep 18, 2008
I've loaded a swf into a MovieClip and I want it to be removed when I hit a button. My attempt to do so is like this:
swfContainer.removeChild(swfLoader);
At first it seem to work but since the loaded swf contains sounds and music the music continues to play.
Anyway heres the code for loading the swf:
View 4 Replies
May 21, 2009
Is there a way to remove a class linked to a movieclip? For instance, I've got a ball (e.g. ball0_mc) that's placed in a target. The way the ball is dragged and dropped into a target is by using a class called Ball. What I would like to do is remove the Ball class from ball0_mc once it's been placed in a target so that it can't be dragged or dropped anymore.
View 2 Replies
Jul 20, 2009
how do i go about removing a post?
View 1 Replies
Apr 10, 2010
It's a simple self-checkout grocery thing and I want to list the items the user is "buying" after typing in the appropriate code, but I can't get it to stay at nine lines only in the dynamic text field. I was told to use array.shift() to get rid of the first value in the two arrays so that I have an easy way by keeping the arrays at nine values, but it doesn't seem to work right.. It'll get rid of the first value, but only once and it'll add a blank value and then continue happily adding to the length of the array. Google has failed me so far so I suspect it's something else in my code.[code]
View 1 Replies
Mar 2, 2011
I am having issues with trying to insert a "mailto" link in a flash file. I can create the text no issue, but as soon as I add a link to the text it removed the "dot" and the @ symbol from the url and scrunches all the letter of the email address together, sometimes to the point where some of the letters aremissing. The first image shows the url on the stage, the second image is a test of the scene. It is very frustrating and I don't know how to fix it. I have deleted the entire line and redone it, but still no joy.
View 1 Replies
Aug 10, 2011
Here it is:
var ZombieInstanceTimerL:Timer = new Timer(8000,60);
ZombieInstanceTimerL.addEventListener(TimerEvent.TIMER, ZombieTimerLfunction);
ZombieInstanceTimerL.start();
[Code]....
Basicly im first setting a timer of 8 seconds for a zombie to sprawn then it sets the properties and then using the addChild method it adds the zombie every 8 seconds. then i made the zombie move but as if it hits the character i make it stop and go to the attacking scene which is frame 4 and then when it isnt hitting it, it goes back to frame 2 which is walking,, then i made a Zombie death code which works by in the zombie attack class it has hittests for all the weapons and it reduces a varible in a GlobalVaribles class the varible is called ZombieHP and here it says if ZombieHP is below 1 it should go to 3 which is the death scene and add a point to the score but the hp and gotoAndStop affects all of the zombies so when it hits one they all die how can i make it so only the one its hitting can be affected..
View 3 Replies
Aug 12, 2011
I found some AS2 code for creating a XML dynamic photo gallery, with thumbnails and big selected image. I extended that for more than one gallery, and all worked well except one thing: when I load a gallery with, for example, 6 photos and return to one with 2, the difference of 4 thumbnails of the first gallery remains, so the problem is that I don't know how to remove the mc instances that I've created with createEmptyMovieClip function. The code of the function that creates every thumbnail is:
function thumbnails_fn(k) { thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth()); tlistener = new Object(); tlistener.onLoadInit = function(target_mc) { target_mc._x = hit_left._x+(target_mc._width+5)*k; target_mc.pictureValue = k; target_mc.onRelease = function() { p = this.pictureValue-1;
[code]....
k is the number of the image to create this thumbnail, and thumbnails[cat_actual][k] is the path that contains the thumbnail to show. I've tried to use the removeMovieClip(); function with thumbnail_mc but doesn't work.
View 3 Replies
Aug 16, 2011
i am loading a jsp file, which had some space at the beginning. i want remove the space,then i need ot parse the data, just like ignoreWhiteSpace in xml.
View 5 Replies
Jan 8, 2009
At some point I will have created a MC on the stage. Later on, I want to put a different on in its place. The original MC may, or may not, be there.So I need to first check and see if it is there, whack it if it is, then add my new one.I know the name of the variable I used to create the MC, but I think the problem is I did this from INSIDE another clip. When I am trying to find it and remove it, I am outside that clip, so I don't think the main timeline knows of that variable. So when I try:if(ribbonEGM) removeChild(ribbonEGM);[code]How can I test and remove the ribbonEGM clip from the main timeline?
View 9 Replies