-
Website
http://drawlogic.com/ -
Original page
http://drawlogic.com/2007/09/20/howto-using-loaders-in-as3/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
protopop
1 comment · 2 points
-
_mark
1 comment · 2 points
-
Igre
7 comments · 1 points
-
carbontwin
1 comment · 1 points
-
drawcode
15 comments · 1 points
-
-
Popular Threads
-
Web Sockets in Google Chrome and Proposed Standard for HTML5
4 weeks ago · 5 comments
-
Web Sockets in Google Chrome and Proposed Standard for HTML5
so if i wantd to load an external swf and display it twice on the screen, with different dimensions, how could that be done? could i make a copy of the loader?
I want unique names because I want to know what loader the user clicks on (using mouse event handling).
Is there a way to assign loaders a name or some unique tag so i can retrace what the user clicked on?
http://www.stimuli.com.br/trane/2007/nov/25/loa...
Thanks
Xavier
I have an issue .I have to load an dynamically load images into movie clip in flash cs3 as3.
The code is available in the link: http://drawlogic.com/2007/09/20/howto-using-loa...
with the code
1. var request:URLRequest = new URLRequest("content.swf");
2. var loader:Loader = new Loader();
3.
4. loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
5. loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
6.
7. function loadProgress(event:ProgressEvent):void {
8. var percentLoaded:Number = event.bytesLoaded/event.bytesTotal;
9. percentLoaded = Math.round(percentLoaded * 100);
10. trace("Loading: "+percentLoaded+"%");
11. }
12. function loadComplete(event:Event):void {
13. trace("Complete");
14. }
15.
16. loader.load(request);
17. addChild(loader);
But only one image can be uploaded I want to load External IMAGES into a Movie Clips.
Pease help me in this.
With Regards
AShok
And your pages look WERY PERFECT!!!!! in my taste..
// load in images dynamically
var leftloader:Loader = new Loader();
leftloader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
leftloader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
var rightloader:Loader = new Loader();
rightloader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
rightloader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
function loadProgress(event:ProgressEvent):void {
var percentLoaded:Number = event.bytesLoaded/event.bytesTotal;
percentLoaded = Math.round(percentLoaded * 100);
trace("Loading: "+percentLoaded+"%");
}
function loadComplete(event:Event):void {
trace("Complete");
}
var curimg=0;
function loadImage(thisframe) {
curimg++;
var request:URLRequest = new URLRequest("images/img"+curimg+".jpg");
if (thisframe=="leftframe") {
leftloader.load(request);
leftframe.holder.addChild(leftloader);
trace ("load left");
} else {
rightloader.load(request);
rightframe.holder.addChild(rightloader);
}
}
loadImage("leftframe");
I managed to patch this using the flash.media.SoundMixer.stopAll(); methoid but this is ONLY a patch. My memory is getting killed!
It appears adobe knows about this problem but please tell me someone has a solution!
Must i (can i) unload the parent?
Yes the new Display Object Tree allows you to load in objects into the display tree with addChild() on amy movie clip or the stage. If you addChild it will simple append the object. If you want to clear out the old one you can removeClip() or removeClipAt(index) before loading in the same location. You can removeClipAt(0) for clips that have no children to remove it from the display tree.
removeClip() and removeClipAt() are not standard Flash actions are they?
I cannot find them in the help-function.
with removeChildAt(0) i remove a child in the loaded movie
with parent.removeChildAt(0) i expected a small success but instead Flash crashes. (for some of you that maybe very logical, i simply copied it from another forum)
there is no such thing as removeParent()
A solution may be to start with an empty movie that loads another movie in a targetclip. The loaded movie can with a mouseclick load another movie in the targetclip. Sounds simple, but does not work as i expect it. Any suggestions?
i tried this:
loadOther_btn.addEventListener(MouseEvent.MOUSE_UP, loadOther);
function loadOther(event:MouseEvent):void {
parent.request = new URLRequest("otherMovie.swf");
parent.loader.load(request);
}
var mRequest:URLRequest;
var loader:Loader= new Loader();
load400_btn.addEventListener(MouseEvent.MOUSE_UP, loadOther);
function loadOther(event:MouseEvent):void {
removeChildAt(0)
mRequest = new URLRequest("otherMovie.swf");
loader.load(mRequest);
addChild(loader);
}
var mRequest:URLRequest;
var loader:Loader= new Loader();
loadOther_btn.addEventListener(MouseEvent.MOUSE_UP, loadOther);
function loadOther(event:MouseEvent):void {
while (numChildren>0)
{
removeChildAt(0);
}
mRequest = new URLRequest("otherMovie.swf");
loader.load(mRequest);
addChild(loader);
}
HEEEEELP :( :( :(
I hate winter! I want summer!
Someone very much loves winter :(
I Wish to know whom more :)
For what you love winter?
For what you love summer? Let's argue :)
Thanks for this! I got one question and would be really happy if you knew the answer.
i'm loading 50 thumbs at once. Listener is set.
thumbLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,thumbsLoaded);
i want to know name of just loaded loader
function thumbsLoaded(evt:Event):void
{
thumbLoader.name ??
}
all i figure out so far is i can see file url through contentLoaderInfo like this
trace(evt.target.url);
it would be great if there was a chance to set name of that loader and later get it when it's loaded.
any hints ?
cheers
Dominik
http://www.delay.pl/
You probably want to write up us use something like http://code.google.com/p/bulk-loader/. This will help you with large sets of data to load and finding them.
Can you please tell me the code for that
the class archived: http://chargedweb.com/labs/files/LoaderUtil.zip
find more useful stuff at my labs.
Cheers