Jump to content
Search Community

tkk11

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by tkk11

  1. Odd, it's saying I've got a null object reference when I try to do trace(e.target.rawContent.loaderInfo.width); or any other property of loaderInfo. var headLDR:SWFLoader = new SWFLoader(path+cFolder+"Header.swf",{name:"header", alpha:1, onComplete:headComplete}); headLDR.load(); function headComplete(e:LoaderEvent) { trace(e.target.rawContent.loaderInfo.width); } gives me the following output: TypeError: Error #1009: Cannot access a property or method of a null object reference. at com::chapterPage/headComplete() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at com.greensock.loading.core::LoaderCore/_completeHandler() at com.greensock.loading::SWFLoader/_completeHandler() When I run "trace(e.target.rawContent.loaderInfo.url)" it gives me the same error, and tracing "e.target.rawContent.loaderInfo" gives me "null". Odd, because there's definitely something in there. Calling the loader directly, or putting it in a queue with the name "header" and calling with 'queue.getLoader("header")' does the same thing. This method works fine for my image loaders.
  2. No, that's the whole thing. I'm wondering if having been exported from After Effects is the problem?
  3. Hi. I'm having some issues trying to figure out the native width and height of a SWF I'm loading. Here's my code: var headerLDR:SWFLoader = new SWFLoader(path+"Header.swf",{name:"header", onComplete:headerComplete}); headerLDR.load(); function headerOncomplete(e:LoaderEvent) { trace(e.target.content.width); //gives me "0", which is certainly incorrect trace(e.target.rawContent.width); //also gives me 0 var rawContent:DisplayObject = e.target.rawContent; //works, I can addChild and it shows up just fine. var bounds:Rectangle = rawContent.getBounds(rawContent); trace("native width: " + bounds.width + ", height: " + bounds.height); //outputs "native width: 0, height: 0" } Any idea why it can't get the width and height of the SWF? Every thing I've tried from the documentation and other posts on this forum gives me an output of 0. Thanks in advance.
  4. Wow, not sure how I messed that up. I need to read the Doc more carefully next time Thanks!
  5. Hello, there. I am trying to load an FLV with the greensock video loader, and once that is complete, load an SWF file. However, the VideoEvent.COMPLETE doesn't seem to be triggered once the FLV is done playing. Any ideas? Here's the code: import com.greensock.loading.*; import com.greensock.loading.display.*; import com.greensock.*; import fl.video.VideoEvent; import com.greensock.events.LoaderEvent; import flash.events.*; import flash.display.*; import flash.net.URLLoader; import flash.net.URLRequest; import flash.utils.setInterval; import script.menu.caurina.transitions.*; //create a VideoLoader var video:VideoLoader = new VideoLoader("gfx/ngvcFlashIntro.flv", {name:"myVideo",container:this,width:1024,height:768,scaleMode:"none",bgColor:0x000000,autoPlay:false,volume:0,requireWithRoot:this.root,estimatedBytes:75000}); //start loading video.load(); var queue:LoaderMax = new LoaderMax({name:"mainQueue",onProgress:progressHandler,onComplete:completeHandler,onError:errorHandler}); //append the VideoLoader queue.append( video ); //start loading the LoaderMax queue queue.load(); function progressHandler(event:LoaderEvent):void { trace("progress: " + event.target.progress); } function completeHandler(event:LoaderEvent):void { //play the video video.addEventListener(VideoEvent.COMPLETE, loadStage); video.playVideo(); //tween the volume up to 1 over the course of 2 seconds. TweenLite.to(video, 2, {volume:1}); } function loadStage() { trace("loadStage called"); var tmpMC:MovieClip = new MovieClip(); var myURL = "landingPage.swf"; var myRequest:URLRequest = new URLRequest(myURL); var loader:Loader = new Loader(); tmpMC.addChild(loader); addChild(tmpMC); loader.load(myRequest); } function errorHandler(event:LoaderEvent):void { trace("error occured with " + event.target + ": " + event.text); }
×
×
  • Create New...