flash.display.Loader
- Started
- Last post
- 10 Responses
- widget
Trying to load in an external .swf using actionscript 3.
I'm using:
myMovieClip.flash.display.Loader... 100);I thought this would be it???
- rson0
are you importing
import flash.display.Loader;
- stupidresponse0
import flash.display.*;
import flash.net.URLRequest;
var ldr:Loader = new Loader();
var url:String = "url";
var urlReq:URLRequest = new URLRequest(url);
ldr.load(urlReq);
addChild(ldr);- beat merson
- import flash.display.*;
the * indicates the entire class is being imported? -->PonyBoy - excuse my ignorance again..
I was wondering if there's a direct object in that class you can import -->PonyBoy - in place of that *.
meaning:
import flash.display.someth...PonyBoy - argh... so hard to get a lengthy Q out on here... feel free to completely ignore me. ;)PonyBoy
- cheers. it works!!widget
- rson0
import flash.display.Loader;
var myLoader:Loader = new Loader();
myLoader.load(myRequest);
- PonyBoy0
does that all have to be in an external as file all loaded into a 'package'?...
... then you simply call the function via a path through the class on the main timeline? Or can you script all this on the main timeline?
...
... i doubt that makes any sense... I'm just looking for the 'best' way to approach as 3.0... I was deep into reading a heavy book on it all but have yet to put it all in practice.
- rson0
PonyBoy Yes you would have to wrap this up in
package {
}and import it in the the pub settings or do something like
var image:BitmapData = new className();Im still learning so if im off someone yell at me
- stupidresponse0
you could do import flash.display.Loader specifically if you'd like.
and it could go straight on the main timeline, if you were so inclined.
- widget0
ok, so i used this (from stupidresponse):
import flash.display.*;
import flash.net.URLRequest;
var ldr:Loader = new Loader();
var url:String = "url";
var urlReq:URLRequest = new URLRequest(url);
ldr.load(urlReq);
addChild(ldr);That works fine using absolute URLs. Is there a way i can call the .swf from a local url? i.e not have to put in the 'http://www....'
- I think relative links should work?
AS3 freaks me out :(slappy
- I think relative links should work?
- rson0
try this
var request:URLRequest = new URLRequest("stuff.swf");
var loader:Loader = new Loader();
loader.load(request);
addChild(loader);this is working for me
- widget0
Thanks rson and stupidresponse!!!
- PonyBoy0
... yes... Thank You!