Actionscript 3 :: Unload Dynamically Loaded Swf After Displaying It?
Jul 8, 2011I am doing a presentation on which I need to use a lot of video clips. I load all these videos dynamically using Loader. [code]...
View 2 RepliesI am doing a presentation on which I need to use a lot of video clips. I load all these videos dynamically using Loader. [code]...
View 2 RepliesI'm creating a banner advertisement in Flash. It pulls all information from an XML file. Images for each product are also loaded externally. Everything is working fine except for 1 thing.
I have an image separator i'm using as a background for each product container to lend a bit of separation to each product. But when I try to add it using code it's only added to the last item. Doesn't matter if it's 10 items or 2 items...it's only being added to the last one and i'm not sure why. Anyways, i've zipped up the associated files and put it on my webserver. I'm using the Tweener class and have included that in the archive as well.
Here's a link to the archive : Project Files
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]...
I have a shell swf that is loading a swf. How do you have the loaded swf tell the parent loader to unload itself after the loaded swf finishes playing?
View 4 RepliesI have been able to get the external swf files to load and unload from my holder mc no probs. Now I want to complicate things a little.
There are individual background images for each of the eight menu buttons. When a button is pressed I want the new background image to fade in over the top of the previous background image, unloading the old image once the new one has faded over it. Not unloading the bg image and leaving the screen blank and loading a new bg image.
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]...
I have a function called "CallSound" that load sound to a movie clip and play it.I want to create new function that remove/unload the sound from the movie clip, because I want to load another sound to me clip and dont want the the new sound will play with the old one.How can I create a function called removeSound() that remove the sound that loaded before
View 1 RepliesHere is the code that I am using for my button
on(release){
loadMovieNum("CG/images/houseGroups/1fs.swf", i);
i++;
}
And then on the first frame of the timeline I am putting i=10
So every time the button is clicked it keeps loading on top of the last. This all works fine. My question is: How do I unload all of the layers that have been loaded. It seems like it should be an unload i< but that does not work.
can a loaded movie unload itself, ive tried but nothing positive this is the thing, i have a sectiion tha i loaded, and i want a close button in that loaded movie, not in the actual main movie
View 3 RepliesIs there a way to automatically unload movies when a new movie is loaded? eg: 5 buttons, 5 bit of art. At the moment they overlap instead of unloading before the new one loads.
View 4 RepliesI am creating a 40 slide presentation with soundtracks, narration, and animations.Each slide is a separate swf clip).I have noticed that when I load a new clip, the previous clip is still loaded (I wasn't using any background so I could see through the first clip and see the second).This tells me that I should consider unloading the previous clip or use backgrounds.Putting on a background is easy however if I should want to unload the previous clip, how do I do that?Here is how I load the next clip:
mmBtn.addEventListener(MouseEvent.CLICK,loadMM);function loadMM(event:MouseEvent):void {trace("Main Menu Button was Pressed")var loadMain:Loader;loadMain = new Loader();addChild(loadMain);loadMain.load(new URLRequest("mainMenu.swf")); }
Some slides will have many navigation options and others will only have one or two.I have AS in each slide to keep each slide self contained. This makes it easier for me to develop and test.Is there a way to remove the current slide contents (from the stage and memory) and load the next slide? I'm really concerned about the memory usage.
I have my dynamic test field working where it loads my external text by the following
[Code]....
how would I go about unloading the text after it has already been loaded?
I have a shell swf that is loading a swf. How do you have the loaded swf tell the parent loader to unload itself after the loaded swf finishes playing?
View 3 RepliesI came across a lesson on [URL]titled "Vertical 3D Carousel with AS3 and XML".
I completed the tutorial and all worked fine so I then wanted to load the swf into a existing project. The loading of the swf goes fine and when I unload my loader it is removed but only visually as in my output panel in flash CS5 I get an error as follows
TypeError: Error #1009: Cannot access a property or method of a null object reference.at carousel_c_fla::MainTimeline/moveCarousel()
this error repeats over and over again slowing my swf movie.
So does this mean my main flash movie trying to still play / find my unloaded 3D Carousel?
If so how do I unload remove all the AS3 that is trying to run from the 3D Carousel?
I have included the AS3 below from the tutorial page and I understand that this is what I have to remove to "break free" from the 3D Carousel swf when it is unloaded. This is where I am stuck as my knowledge of AS3 is limited
//Import TweenMax
import com.greensock.*;
//The path to the XML file (use your own here)
[Code].....
I am trying to hide an external loaded carousel on button click with the following AS[code]...
I can see the trace ""remove Carousel" but the Carousel.swf is still shown?
When i look in debug mode i can see the _root.holder, but it doesn't hide?
I have a gallery with tween effect which allows the photos to change size.
However, after loaded photos work but i can't unload it!
If i change the 1 to _mc, it's able to unload but then tween won't work.
Feels like i am missing something basic and it's driving me mad.[code]...
I want to display text in a textfield which dynamically creating. Also this textField is creating inside a movicelip which is created dynamically. I used the following code. Its not working.
var mainMc:MovieClip = _root.createEmptyMovieClip("mainMc",1000);
mainMc.createTextField("my_txt",1,100,100,300,100); my_txt.text = "This is my first test field object text.";
[code]......
In my main application I consume a web-service which gives me an array of vendors.There is a add button in the main application, which when clicked a pop-up is opened.I want to display one radio button for each vendor in this pop-up window.This is all I have done so far: 1. In the pop-up I created a radiobutton group (id = vendorGroup).2. vendorGroup has one radio button called Others (this is the default).
In the main app I call pop-up using:
private var addItemDB:addItemForm;
addItemDB = PopUpManager.createPopUp(this,addItemForm,true) as addItemForm;
[code]....
i have created a colour picker that loads movieclips from the library onto the stage.however i need to create a "start over" button that will remove all these added clips.my code is as follows:
Code:
startover.addEventListener(MouseEvent.CLICK, removeallFunction);
function removeallFunction (event:MouseEvent):void
[code].....
I am trying to unload a movie I loaded like this
PHP Code:
loadMovie("slideshow-endsample.swf",movieContainer);
But
PHP Code:
unloadMovie("slideshow-endsample.swf");
Doesnt work?
i have designed a flash projector using as3 in which I have successfully loaded an external swf onto frame 2 of my first scene called "start". i want to include a Restart button in a later scene called "intro", which will unload the external swf as well as restart the entire presentation from frame 1 of my "start" scene. my problem is that I can't figure out how to tell my Restart btn, located in the "intro" scene, to look in the "start" scene to unload the external swf - i need to eliminate the "1120: Access of undefined property..." error when working in multiple scenes.
View 7 RepliesI want my externally loaded flv-movie to unload itself when it is done playing. I read something about cue-Points but didn't find anything useful.
View 3 RepliesThis 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.
I'm not new to flash as2 but as3 is a whole other animal to me. What I have is on button click my script will load a swf movie into a movie clip (videoLoader_mc). What I'm trying to do but can't seem to get is when the parent swf gets to a certain point in the time line I need it to unload what ever movie is in that videoLoader_mc. I've gone through ever tutorial I can find to no avail. [code]...
View 0 RepliesI'm trying to create app. that has 3 main buttons that goto 3 pages each with 15-30 buttons that each load external .swf that covers most of primary swf xpt 3 main buttons. Clicking on those 3 main buttons should unload previously loaded .swf and each loaded .swf should have preloader in its start.
1.) preloader works fine when i launch file separately, but when i load it from main .swf, it just shows "100%" at once...
2.) 3 main buttons doesn't seem to unload loaded .swf...
Main .swf code:
PHP Code:[code].....
I created a flash application that is dynamically displaying xml feeds from content partners. This flash application has a black background and will be called and displayed from the C# windows application. The issue is sometimes when our application loads the flash swf file, the background color turns white so the text being displayed are not readable anymore since they are white. This intermittent and I am using flash cs 5 actionscript 3. Before I was relying on the stage background but after I saw the issue, I already used a solid background container like (vector, png, gif, or jpeg).
View 4 RepliesBasically I need to have;
- interface where a user can choose a font (from pre determined font sets) and input a text string
- This text is then displayed engraved on a ring (jewellery)
I'm not sure the best way to achieve this or if there is a module somewhere that does similar.
My best guess would be to
- using mathematics (sin, cos) to be able to plot the oval (where the text need to be displayed on the ring) on an imaginary graph.
- From here there will be a centre , start and end point. The text will need to be limited as it will eventually following the curve of the ring until it can't be see as it is masked by the angle of the ring
- If using dynamic font then the width of each letter should be possible to obtain with AS.
Then mathematically it should be possible to determine how far away from the centre point on the oval each letter is.
- Following this, dependant on the letters distance from the centre, transformations can be applied to each letter. IE stretch, skew and an emboss filter via the convolution filter.
- Hence this will provide the illusion that the text is following the curve of the ring and the look like it is engraved via the emboss.
I am unable to unload content loaded by loader class.
View 4 RepliesHow to dynamically add wmode="opaque" to already displaying embed elements? Without reloading the elements, the embedded content should not lose its state.
Just setting the wmode attribute with javascript doesn't work.
Removing the element and then adding it again makes wmode take effect, but the flash element loses its state, among other problems. E.g if it's a video player its position/playback status resets. So that solution is no good.
Any other way of displaying content over the embedded element is acceptable as well.
(I'm doing this trough a content script in a Chrome extension if that is of any help.)
This is not a duplicated of How to dynamically add wmode=transparent to Youtube embed code? as there the parameter is added to a frame and not directly to the element it self.
I have the following Actionscript code in my Flex 4 app to display images on a Sprite. Works perfect in the local flash player while developing this:
private function initializePhoto():void {
var photoLoader:Loader = new Loader();
photoLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onPhotoReady);
[code].....