ActionScript 3.0 :: Removing Image Loaded From XML?

Jan 18, 2010

I'm trying to make a flash feature, slideshow, news thing. I think I have ait all done apart from I'm loading images from xml as the background (different one for each story). The problem is I used a tutorial and the code seems to simply add an image on top of the old instead of replacing it. I'm using an alpha transition when the image changes so the image behind is visible for a short time, which isn't the desired effect.Is there a way to either replace the image instead or at least remove the old image?This is the code to load the image url from the xml

Code:
function loadImage(url:String):void
{
imageLoader = new Loader();
imageLoader.load(new URLRequest(url));
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
}

...and this code simply sets the imageArea MC to the loaded image

Code:
function imageLoaded(e:Event):void
{
imageArea.addChild(imageLoader);
}

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Image Gallery Not Removing Previous Image?

Nov 28, 2010

I have an image gallery but I can't seem to get the previous image removed. I have two functions:

ActionScript Code:
function clearLoader():void {
try {
var li:LoaderInfo = slideLoader.contentLoaderInfo;

[Code]....

But in some way not the previous image is removed, but the one before that. Annoying, because if image 1 is larger than image 2, image 1 stays on the background. It is only when loading image 3 the first image is removed from the stage.

View 0 Replies

ActionScript 3.0 :: Removing A Loaded Swf?

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

ActionScript 3.0 :: Removing SWF When Loaded

Mar 29, 2011

I am trying to load an external .SWF into my current .SWF. I have managed to get it loading onto my application, but then once the animation has finished and i click onto another button, i.e. 'gallery' or 'contact' i want the swf to be removed, i know i need to add a remove child somewhere but i dont know how. this is my code.

[Code]...

View 1 Replies

Professional :: Removing Movieclip When Another Is Loaded?

May 27, 2010

I have random buttons on the stage that I have set up so each one, when clicked, will load different movieclip.These movieclips load directly on top of each other in the exact same place.The problem I'm having is the previous movieclip does not clear off the stage when the the next button is clicked.I need to set up a condition that will remove the current movieclip when another button is selected to load the next movieclip.Below is part of my code that needs editing. I've been researching switch, else, and other conditional statements but can't figure out how to make this happen.I have the fla or swf file for viewing, let me know.

// Event Listenershempelbtn.addEventListener(MouseEvent.CLICK,btnActions);fourtyonebtn.addEventListener(MouseEvent.CLICK,btnActions);draycottbtn.addEventListener(MouseEvent.CLICK,btnActions);eg

[code].....

View 5 Replies

ActionScript 3.0 :: Removing Unnecessary Loaded SWFs Already Seen?

Jan 28, 2009

I'm loading 31 SWFs in total. For example, the first one shows and it has a 'Next' button. When Next is clicked, then it loads the second SWF; and so on until reach a total of 31 SWFs.

No problem here, but thing is that while more SWFs I'm loading, heavier gets the file and little by little it's being taking longer to load. Because when I reach the 31 SWFs, I got a total of 31 childs loaded one after another.

I've been thinking in the posibility of removing the SWFs once they are no longer seen but can't find how to do it...

This is what I'm doing:

ActionScript Code:
import flash.events.MouseEvent;
import flash.display.Loader;
import flash.net.URLRequest;

[Code]....

It basically does this in every one of the 31 FLAs, so, as you can see, it goes loading and loading SWFs. Problem, as I said, while bigger the amount of SWFs loaded, slower the process gets. I'm using e.target.parent.addChild because all this is inside a MovieClip called mc.

How to remove the ones I'm no longer using?

View 4 Replies

ActionScript 3.0 :: Removing Loaded SWFs Into MC On Stage

Oct 10, 2009

I am loading external swfs into a MC on the stage. I noticed they are stacking up and not being removed or replaced. How can Iremove the previous loaded swf?

Code:
package {
import flash.display.MovieClip;
import flash.display.SimpleButton;
import flash.display.Loader;
import flash.net.URLRequest;
import flash.events.MouseEvent;
[Code] .....

View 3 Replies

ActionScript 3.0 :: Fps Drop Removing Loaded AVM1 Content?

Nov 24, 2010

Currently I'm working on a flash application that will be used for presentation purpose. The application loads external swf files which are exported from powerpoint. This way people can make there own powerpoint presentation, export with a plugin as swf files included with animations, video or audio.

The presentation itself is a 3D carousel containing icons which represent chapters. Once a chapter is clicked, a page slider opens and loads all external swf files needed for that chapter.When someone is done with that chapter, you can close the pageslider. To make sure the application keeps it performance, it will remove all event listeners, free display objects hold in arrays and get rid of all what won't be used again. This works fine, the memory use goes back to original state and no problem.

Now when I take a closer look at the fps of the application which is set to 60fps, and load AVM2 content, nothing goes wrong whatever I do or close. As soon as I load AVM1 content and display it, the fps stays steady at 60. But as soon I close the pageslider and free up memory, the fps is stuck at 30. As soon I open a chapter with another AVM1 content, the fps restores to 60.Now I thought maybe it's because I did something wrong when I free some memory, so I turned that function off which gets rid of all the stuff. Then I tried again, but again when I load AVM1 content I got 60fps but when I don't display the content my fps goes back to 30. But this problem doesn't exist when I load AVM2 content or even just png's instead of swf files.But when I turn this free memory function on and not display the AVM1 content and which doesn't exists at all on the background anymore, the fps is still 30.

Now I thought about a fix to just restore the framerate afther the pageslider is closed. But as soon I use "stage.frameRate=60" the player crashes completely. how can AVM1 content on display let the application run 60fps, but when removed from memory and not displayed set the fps to 30 and get to 60 again as soon new AVM1 content is displayed? But AVM2 content it's all just fine.

The reason I load AVM1 content is because the powerpoint -> swf exporter can only export AVM1 content.I also checked if the fps of the exported swf is set to maybe 30, but that's not the issue, and besides that it theoretically would use the main swf it's fps.I could set the main application fps to 30 and no one would notice, but I just can't sleep why i can't figure out the issue.Btw when I set the main fps to 30 it won't be reduced to 15fps.

View 3 Replies

ActionScript 3.0 :: Removing Loaded Objects / Events From Player Memory?

May 31, 2010

Is this at all possible? I just finished re-building my entire portfolio site in AS3 because I can't change the frame rate for loaded content in AS2. Now I find out after completely rebuilding this thing that AS2 content gets stuck in Flash Player 9's memory and won't erase on Loader.unload. All my work from years back is in AS2.

View 0 Replies

ActionScript 3.0 :: Removing Loaded External SWF File On Clicking Link

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

ActionScript 3.0 :: Flash - Removing Loaded Child Object B4 Loading A New One

Feb 19, 2012

having trouble removing loaded child object b4 loading a new one i can load a child object with this script if button is pressed:

[Code]...

but having difficulty unloading child object when just that mc_char.btn_darkangel button is pressed. Cause otherwise it just adds another instance then another and another and the different instances kinda pile ontop of each other my question is how can i incorporate removeChild script so that mc_char.btn_darkangel doesn't just pile instances of image ontop of each other

View 2 Replies

Actionscript 3 :: Removing Previous Image?

Dec 21, 2011

Whats a better way to remove an old image or an image that is not there at all?I am working with this XML slideshow and I have tweaked it the way I want, except the first image that loads doesn't disappear. How can I make this statement better? I've tried if (previous || imgHolder.numChildren > 0 ) as well and didn't work

package
{
import flash.display.MovieClip;

[code]........

View 1 Replies

ActionScript 3.0 :: Adding And Removing Event Listeners On Dynamically Loaded MovieClips?

Jan 21, 2009

I've created a drop down list and populated it with dynamic buttons. (I made a DropDown_btn class with a dynamic text field in it and then filled the button text from an xml file). On rollover I tint the button blue and then set the tint back to black on rollout. When you click on the button I'd like it to stay blue until a different button is clicked.

I thought on CLICK I'd run a function like this:

ActionScript Code:
function removeRollover(evt:MouseEvent):void {
evt.target.transform.colorTransform=c;
evt.target.removeEventListener(MouseEvent.ROLL_OUT, btnOut);
evt.target.removeEventListener(MouseEvent.ROLL_OVER, btnOver);
}

...and then I need to addEventListeners back to any button that doesn't have them and set that button back to black. I could do this by looping through an array of the buttons but I can't figure out how to access them as objects.

I also gave them each a property of "buttonValue" when I loaded them so I can access event.currentTarget.buttonValue (which in this case is a number from 1-5) but once again I can't figure out how I might leverage this information.

View 2 Replies

ActionScript 3.0 :: Dynamically Removing Children When Another Image Clicked

Oct 8, 2008

I have 36 images in a movie clip. Inside of that movie clip there are 36 other movie clips containing one separate image. I have figured out how to click on them and add it to the stage. But I can figure out how to get them to remove when another image is clicked. (ex. I click on image 1 it will appear on stage but when I click image 2 it show image 2 on top of image 1.) the thing is I don't want to have to click on the images in order. If any image is clicked the one showing on stage will automatically disappear.

View 9 Replies

ActionScript 3.0 :: Image Cross Fade - Removing Old Instances

Aug 24, 2009

I'm trying to do a simple image gallery with a previous and next button. I have it working nicely with a little crossfade, however I know that I need to remove old instances of my class after they are done being used - I just don't know how to do it. Especially because I want to wait until the top image/instance is fully faded in before deleting the one below it and what if someone clicks the next/previous button before the image is fully faded in?

Here is my main movie:
[AS]
function nextImage(evt:Event):void{
currentImage ++;
currentImage = (currentImage < imageTotal) ? currentImage : 0;
addImage();
}function prevImage(evt:Event):void{
[Code] .....

View 5 Replies

ActionScript 2.0 :: Resize LoadClip Image - Return 0 When The Image Loaded Is Obviously Much Larger Then 0 Pixels

Dec 13, 2007

Some images I load dynamically are too big so I would like to scale them to fit the stage.

[Code]...

this returns 0. Why does it return 0 when the image loaded is obviously much larger then 0 pixels. How do I change the width and height of imgCont to a specified dimension.

View 1 Replies

ActionScript 3.0 :: Aligning An Image That Was Loaded By A Loaded Swf

Jul 28, 2011

I have my main swf (swf1), that loads another swf(swf2). At some point, swf2 loads an external image. What's the best way for swf1 to align the loaded image from swf2??

View 2 Replies

ActionScript 3.0 :: Duplicating An Image Loaded - Clone Image?

Oct 2, 2009

How should I go about cloning an image loaded form the server and adding it to the end of the first image loaded? Would I use bitmap clone? My attempts with this failed[URL]

Code:
//Creates new image loader
var imageLoader:Loader;

[code].....

View 1 Replies

Image :: Get The Loaded Image Path In Flex?

Feb 29, 2012

want to get the loaded image path location,how to get the path

<mx:Image source="@Embed('assets/image001.png')" x="240" y="41" width="148" height="118" id="img"/>

i need to get this address source="@Embed('assets/image001.png')" how?

View 1 Replies

ActionScript 3.0 :: Replace Some Code Which Loaded An External Image And Triggered And Function Once Completed With Code That Uses And Embedded Image?

Jun 10, 2009

I am trying to replace some code which loaded an external image and triggered and function once completed with code that uses and embedded image. The relevant code looks like this.

Code:

[Embed(source='globe.png')]
public function Globe()
{
var imageLoader:Loader = new Loader();

[code]....

The commented out section is where it used to take the loaded image and apply it to a texturemap.I need to replace the lines of code in the first function with something that calls the second function correctly.

I have tried using function imageLoadComplete (e:Event = null)and calling it with imageLoadComplete(); in the first function but although it compile and runs without error, the program does not work properly. I suspect this is to do with the dispatchEvent(); line which I do not understand.

View 4 Replies

IDE :: Loaded Image Gets Cut Off?

Jun 1, 2009

I've having a weird issue with images being cut off when i load them into flash... I'd like to load in a "strip" that i made in photoshop. This strip can be as long on a 3600+ pixels wide. I'm completely confused on this as i made a file successfully loading a strip image in and it works great. So, i COPY the file and change the image to a new on...and it gets cut off. Same code, same everything, but EVERY (including the one that successfully loads) gets cut off in any new file i make. I DON'T think it's the code as it's worked once, but something with settings maybe?

View 1 Replies

Actionscript 3 :: Getting Each Loaded Image?

Mar 27, 2010

The images only loads into the last MC, how to make it load into each MC?

private function imageHandler():void {
imageBox=new MovieClip();
imageBox.graphics.lineStyle(5, 0xFFFFFF);
imageBox.graphics.beginFill(0xFF0000);

[Code].....

View 1 Replies

ActionScript 2.0 :: Check If Image Has Loaded?

Feb 7, 2009

i know this has proberbly been covered before, but how do i do this:i want my script to run a function only after an image has loaded using loadMovie
is that possible?

View 3 Replies

ActionScript 1/2 :: Add A Loaded Image To 2 Movieclips

Nov 9, 2011

I have loaded an external image into a movieclip (say mcA)  using  MovieClipLoader.
 
In AS3, we can use addChild to add a movieclip into another movieclip or sprite, but in AS2, we have to use attachMovie to attach the movieclip from the Library.  Since this is an external file on server, I cannot use attachMovie.
 
I need to add the content of mcA, i.e. the image, to another movieclip (say mcB) so that both mcA and mcB contains the same image.
 
How can I do this in AS2 without loading again the image from the server?

View 3 Replies

Actionscript 3 :: Loaded Image Cannot Be Seen On The Screen?

Jun 10, 2010

I load many images simultaneously with different Loader class. When loaded I add content of loaders to the movieclips which are child of some other movieclip which is child other... I check that images are loaded addChild method is called, but loaded images cannot be seen on the screen.

Actually, sometimes images can be seen, but sometimes cannot be seen.

Do I need to rerender some DisplayObject? Something similar...

View 1 Replies

AS3.0 :: Flash - Set Size Of The Loaded Image?

Sep 23, 2011

I'm loading images from xml file. I want the images to have standard width when they are displayed.

Here are the snippets of the code that do the image processing:

var allThumbs:MovieClip = new MovieClip();
addChild(allThumbs);
allThumbs.width = 200;
allThumbs.height = 200;

[Code].....

this lines, where I wanted to resize the images before they show up in the ScrollPane.

View 1 Replies

ActionScript 2.0 :: Get Loaded Image Width?

Jan 12, 2009

I have created some movie clips dynamically using createEmptyMovieClip. Then I am loading images into the clips using the MovieClipLoader. In the onLoadComplete of the loader I am trying to position the clips based on the _width and _height.

I would think that since the clips are loaded as indicated by the OnLoadComplete firing they would have a _width, but it comes up as 0. What gives?

View 3 Replies

ActionScript 3.0 :: Get Width Of Loaded Image?

Jun 29, 2009

I have a simple gallery where I'm loading thumbnails from an XML file.

The thumbnails are loaded into a containing MC (thumbCon), I want to be able to space the thumbs using the width of the thumbs.

How do I capture the width of the loaded thumbs?[code]...

View 1 Replies

ActionScript 2.0 :: Loaded Image Auto Fit The Mc

Aug 26, 2009

img_mc.loadMove("xxx.jpg",0); i want the pic auto fit to img_mc width an height how can i do using as2??

View 1 Replies

ActionScript 2.0 :: Link Xml Loaded Image To Url

Mar 22, 2010

I need some help with the actionscript 2, needed to link my xml loaded image to url. This is what I have in my xml file, for the image I need to link to a url:

<image imageUrl="_sustainable_small_1.jpg" />

I am not sure how to add the link tag, in the xml, correctly. Also, I do not know the AS needed, for the .fla file.

View 9 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved