ActionScript 3.0 :: Unloading A Loader Object?

May 30, 2010

I'm currently working on a application that displays a webcam picture stream, so what I do is read a image repeatedly from a url and for this I use the loader object, the problem is that when I tested this the browser started to take RAM until it frozen.I used unload() and dispose() but they only hide the image, it still takes memory.This is the image class I made:

ActionScript Code:
package
{

[code].....

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Unloading Swf's In UI Loader?

Nov 5, 2009

I am having some problem removing a null object and I realise that I have not been unloading my swf's properly. Could someone take a look at what I have been doing and tell me what I can do to make it better. I am putting my website in an exhibiton of my design work and if it lagged up due to all the clicking it would suck!

Code:

aboutBtn.addEventListener(MouseEvent.CLICK, aboutLoad);
function aboutLoad(e:MouseEvent):void {
ldr.unload();

[Code].....

View 19 Replies

ActionScript 3.0 :: Unloading Swf's In UI Loader

Nov 6, 2009

I am having some problem removing a null object and I realise that I have not been unloading my swf's properly. Could someone take a look at what I have been doing and tell me what I can do to make it better. I am putting my website in an exhibiton of my design work and if it lagged up due to all the clicking it would suck! so its important I get this right I just need a little help if someone wouldn't mind.[code]

View 2 Replies

ActionScript 3.0 :: Pre Loader And Unloading Swf?

Jun 1, 2011

after fighting for 3 days to get my code to work properly i found out that there is a bug in flash player nine & ten.It cant remove a loaded swf 100% if you use unload();Then again you can use unloadAndStop(); but this also is not working 100% meaning removing everything from the loaded or loading swf.unloadAndStop() is a much better solution than using unLoad(); in my case, but still if i click on a button while my swf is loading and that button has for function to unloadAndStop the swf it will not remove it completely and throw me an error Error #2036.my website still works but it could be working much better and opens the door to errors while people visit my website.im fixing these error and what not by methods that i think should not be there in the first place.

View 0 Replies

ActionScript 3.0 :: Unloading The Loader?

Jan 25, 2009

is this the right way to do it?

PHP Code:

if (imageLoader != null){imageLoader.unload();} 

or i need to say this:

PHP Code:[code].....

View 8 Replies

Actionscript 3.0 :: Unloading Loader Objects?

Mar 23, 2010

Before i lay down the problems, allow me to present the flow of my files.My flash app starts with index.swf. On load, index.swf automatically loads preloader.swf. The preloader.swf then loads main.swf by a button-click.

View 2 Replies

ActionScript 3.0 :: Loading / Unloading From Loader?

Mar 28, 2011

Part of my UNI degree is covering AS3 and I'm having to build a game using Flash.

I have hit a problem trying to load a new SWF after unloading the current one that is auto loaded at runtime using the loader. I have a button in the 1st SWF that unloads the current one successfully but I'd now also like to get that same button to load up an alternative one.

My host file has the following code:

import flash.display.Loader;
var startGame:Loader = new Loader ();
addChild ( startGame );
startGame.load ( new URLRequest ("interface.swf"));

My loaded SWF ("interface.swf") has the following code to unload it when required using the button:

function closeInterface(e:MouseEvent):void {
MovieClip(parent.parent.parent).startGame.unloadAn dStop();
}

how to load up the next SWF at the same time

View 2 Replies

ActionScript 3.0 :: Unloading A Loader-Loaded Child?

Jun 16, 2010

I have a master swf that uses Loader to load in an external swf. I need to load a back button on top of that stack as a separate Child - and I have code in that loaded Child that needs to Unload the Loader-Loaded swf, unload the Buttons, and move the main timeline to another frame.

View 2 Replies

Flash :: Unloading Swfs Loaded With Loader::load()?

Jan 23, 2010

I'm using Loader::load() successfully to load swfs into my main swf and then I add them as a child of a Sprite. When other events occur I want to remove the swfs as needed. I have looked at unload() and at removeChildAt() without success.

I only added the addChild() call to try to pin down the loaded instance so I could remove it. The loading works fine without the addChild();

I have also tried publishing to player v.10 and using myLoader.unloadAndStop(); but this has no effect either;

The following demo code shows my problem. I see one child added and one removed but intro.swf is still playing away.

import flash.display.Loader;
import flash.display.Sprite;
import flash.display.LoaderInfo;

[Code].....

View 1 Replies

ActionScript 3.0 :: Unloading Image In Loader On Thumb Click?

May 6, 2009

The thumbs load on a grid and when I click on the thumb they load in the loader. Now I am having trouble removing them. The tutorial has the remove function on the loaded large image so when you click that it removes itself. I would like so that when you click on the a thumb the current image will unload and the thumb that is clicked on will load but can't figure out how to get it to do that. I figured I'd just add a CLICK listener for the "removeFull" function to the "callFull" function but I think it cancels itself out.

Here is the code I am using: (the code to load and unload is toward the bottom)

Code:

var columns:Number = 2;
var my_x:Number = 25;
var my_y:Number = 75;
var my_thumb_width:Number = 65;

[code]....

View 4 Replies

ActionScript 3.0 :: Unloading Image In Loader On Thumb Click

May 2, 2010

I found some code to create an XML based Flash gallery (I have lots of XML experience, not so much flash!) and modified it some to make the images show up exactly where I want them to on the stage. The problem I can't figure out is how to make the current image unload and the thumb that is clicked on load. Right now, the images just stack up on top of one another. I've searched all over to find a solution, but so far nothing I tried has worked. I haven't even gotten around to adding tweens to the gallery yet!

[Code]...

View 1 Replies

ActionScript 3.0 :: Way To Connect Loader Object Of Photo Object With EventRatio Object?

Mar 25, 2010

So I have this Photo class than handles loading a pic, and dispatches an event when the loading is done with:[code]which is simple and works, but now I'd like to make something more advanced. I'd like to dispatch the load ratio.So far I have extended the Event class, with my own EventRatio class, and I can put properties on that class. Which is cool, but I need something more dynamic than just sending a fixed value.So, what is the best way to connect the Loader object of the Photo object, with the EventRatio object?

View 5 Replies

ActionScript 2.0 :: Unloading An External Swf Using The MovieClipLoader Object?

Jun 6, 2007

I"m having a tiny problem with unloading an external swf using the MovieClipLoader object. This is what I"m doing:

Code:
if (mcLoader.unloadClip(container)) {
trace(container.testVar) // shows testVar
}
button.clickHandler = function () {
trace(container.testVar) // says undefined when clicked
}

So what's happening is right after I call unloadClip it's still loaded however if I click the button at some point after unloadClip is called it shows that is has been unloaded. So obviously there's a little bit of a delay while things are being unloaded. My question is, does anyone know of a way to detect when the clip is unloaded like with an event listener or something? I want to be able to load up another swf after one is unloaded for the level maps for my game I'm working on.

View 2 Replies

ActionScript 2.0 :: Class References Are Still There After Unloading Object?

Sep 29, 2004

loading external SWF's and its class files hanging around after the movie is unloaded....Its kind of tricky to explain, but you can see it very clearly in this file... http:[url]...Just run the main_stage.fla within flash [mx 04] and you'll see that if you click "Tester A" it will trace out "My Name is Tester A", then if you click on "Tester B" it will load a different swf, with a different class, but still trace out "My Name is Tester A" when it should be "My Name is Tester B"....

I have tried, unloading the swf's, removing the mc_Dropper and re-attaching it, re-declaring the variable testObj as null before declaring the class,

View 2 Replies

ActionScript 3.0 :: Loader Object Very Very Slow?

Mar 3, 2009

I've been using the following image class (feel free to use it ) for quite some time now... but recently it's been working very very slowif i do a var test:Afbeelding=new Afbeelding("test.png");and test.png=4 Kb in size, then it takes up to 2-3 seconds before it appears on my screen, also it takes that long before i can get the size or so... so var test:Afbeelding=new Afbeelding("test.png");trace(test.width);on't work..I don't think i changed anything to my class... but if somethings missing or if somebody knows where the problem is.o fixit

class Afbeelding:
package
{

[code].....

View 6 Replies

AS3 :: Flash - Copying A Loader From One Object To Another

Jul 20, 2010

I have two classes, call them A and B. They both contain a Loader object. In class A I load content into the Loader object.

public class A {
var loader:Loader;
public function A():void {

[Code].....

But that's not what I want. I don't want to manage a bunch of children when I know I only have one child but just want to change its content.

Is there a way to copy/assign a Loader directly? I tried assigning to 'content' but that's read-only. Basically I have an array of Loader objects that all get loaded with images. I then have a single Loader that's on the stage and I want to assign to it images (Loaders) from my array.

View 3 Replies

Actionscript 3.0 :: [object Loader] Not Reloading

Jan 29, 2009

I have an XML image that I loaded into a sprite and then the sprite into an array, I'm trying to now retrieve the [object Loader] that is in the original array, and display it. however, I keep getting a blank space instead.

View 5 Replies

Actionscript 3.0 :: ReplaceChild In Loader Object

Jan 9, 2011

I'm having some 'Loader-Object'-issues. I have this sub-menu, with three buttons, each fetching an external .swf. But after fetching the first swf, and trying to load the second, the old one stays on the stage with the new one on top. Is there any way of re-using the loader object and just replace the mc? Or a way of checking whether the other Loader-Objects have been 'filled'? My code is as follows:

[Code]...

View 5 Replies

ActionScript 3.0 :: Getting The Loader Object Via ContentLoaderInfo?

Mar 6, 2009

I am loading images dynamically from the web into my swf. I use a loader class and add an Event Listener to the loader so it will add the image to the stage when done.

Code:
for (var i:int = 0; i < number; i++){
var poodleLoader = new Loader();
poodleLoader.load(new URLRequest(urls[i]));
poodleLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, showPoodle);
}

But what I do not manage to do is referring from the Event.COMPLETE-event to the loader object in my showPoodle-function. How do I refer to it? I was thinking addChild(e.target.parent.data) but it tells me the contentLoaderInfo has no parent?

View 2 Replies

ActionScript 3.0 :: SWF In Loader Object Playing Before It's Displayed?

Apr 28, 2009

How does that work? How come when I use "addChild(l);" (l being my Loader object), the SWF has already played to it's first stop point?How do I prevent that? It actually throws an error because of it.

View 4 Replies

ActionScript 3.0 :: MovieClip And Loader - No Object Is There Or Seen On Stage

Nov 3, 2009

Basically what im doing is making a whole bunch of movieclips using a loop and loading an image into them..The movieclip is a success, but no object is there or seen on stage...

[Code]...

View 2 Replies

ActionScript 3.0 :: Access Child Of Loader Object?

Feb 11, 2011

it's very simple thing i have a swf file try.swf, and it have little bit animation, I stop it's animation on timeline frame 1and i use this code... to load try.swf in other flash fileimport flash.display.Loaderimport flash.net.URLRequestvar ld:Loader=new Loader()var rq:URLRequest=new URLRequest("try.swf")ld.load(rq)addChild(ld)now i hv load try.swf in ld Loader now I want when this loaded then try.swf gotoAndPlay though frame 2 and start showing animation.

View 1 Replies

Flash :: Get Width And Height From Loader Object?

Feb 22, 2010

package
{
import flash.display.*;

[code].....

View 3 Replies

Actionscript 3 :: Return Loader Object As Class?

May 16, 2011

I have to implement a menu with icons using actionscript only. I create a data provider from XML and set

menu = Menu.createMenu(null, dataArray, true);
menu.iconFunction = iconFunction;

Till here everything is fine and my menu is presented, but only with labels.
I create iconFunction as following:

private function iconFunction(item:Object):Class
{
var st:Loader = new Loader();
st.load(new URLRequest(item.icon));
return ?;
}

how do I return my loader object as Class?

View 2 Replies

Actionscript :: Object (key-value) Use For URLRequest/Loader Classes?

Aug 19, 2011

I am trying to get my Actionscript program to turn in a key-value (more specifically: a key, value1, value2) object into a server. I am doing the html request properly, but I'm not sure what kind of object to send;

View 1 Replies

ActionScript 3.0 :: Object Loader Loaded And Not Loading

Jan 27, 2009

I loaded 5 JPG's into specific locations of an array via the URLRequest. So now when I trace my array:

[Code]...

THE PROBLEM: when I scan getXMLlinksArray and see that its NOT null, and i try to addChil to xmlImgHolder and then to spriteHolderArray, I just get a blank space. The debuger is showing that spriteHolderArray contains some loader info and the appropriate URL up until I load it with the existing loader from getXMLlinksArray. Then it says it doesn't have any conentedLoadedInfo.

View 1 Replies

ActionScript 3.0 :: Access Loader Object From Class?

Jul 27, 2009

I created a button class with a method that will allow me to control an external SWF. However, the loader for the SWF is created on my main timeline. Is it possible to access the loader object from within my button class?No matter what I try I either get an error that the variable is not defined (rightfully so because I haven't defined it in the class, it's defined on the main timeline) or that the object is null (when I declare the loader from within the class, which I know is wrong as well)

View 4 Replies

ActionScript 3.0 :: Checking Whether A Loader Object Is Loading Something

Aug 7, 2009

Is there a way to check whether a loader object is in the process of loading something? I need to create an if statement that checks if the loader has an open connection. So far, what I thought of is:

ActionScript Code:
if(loaderInstanceName.contentLoaderInfo.bytesLoaded > 0)
{
// do something
}

Here, I'm just assuming that if bytesLoaded is greater than 0, than it's probably loading something. But I don't think it will revert back to 0 after the loader finishes loading an external resource. So after that, bytesLoaded will always be greater than 0 even though it isn't in the process of loading anything. Is there any other property that I can use which says whether the loader object has an open connection?

View 2 Replies

ActionScript 3.0 :: Loader Object Sometimes Does Not Display Even Though It Is Loaded?

Oct 21, 2009

I have a site loading a large number of thumbs and even a video at the top. Every once in a while the loader object gets stuck. I have an EVENT.COMPLETE on it and it doesn't appear to get called.

Any help? This appears to happen primarily on the first time loading. I am using Safari on Mac for the browser as well, if this makes a difference

View 1 Replies

ActionScript 3.0 :: Create Loader From Event Object?

Oct 15, 2010

I'm listening for a Loader to COMPLETE loading, and then I jump to a handler function "thumbLoaded". I would like to create a new Loader obj. each time I enter the "thumbLoaded" function. I would like this new Loader to be equal to the Loader that triggered the COMPLETE event. But I don't know the correct syntax to refer to that Loader. I'm trying to refer to the "parent" of the contentLoaderInfo object (ie, the Loader object itself). I've tried both "target.parent" and "currentTarget.parent". I get an error that says "parent is not a valid property of the loaderInfo object".

ActionScript Code:
function loadThumb():void{
if (i < kitchensGallery_xml.kitchen.length()){
var thumbLoader:Loader = new Loader();

[Code]....

View 4 Replies







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