fauzihasnan Posted September 7, 2012 Posted September 7, 2012 When I try to resize it, it doesn't show. It works fine like this ------ var loader:SWFLoader = new SWFLoader("livingroomout.swf", {container:this); //Load Swf loader.load(); { ----- but when I try to resize the swf, by adding the height and width properties, it doesn't appear at all ----- var loader:SWFLoader = new SWFLoader("livingroomout.swf", {container:this, width:300, height:300}); //Load Swf loader.load(); { ----- any help? pleasee???? im a noob at this
GreenSock Posted September 7, 2012 Posted September 7, 2012 A few questions: Are you using the latest version of LoaderMax/SWFLoader? Does your subloaded swf have a size set correctly (like a native size)? Is it something you published from an FLA file? Can you post a very simple example set of files that clearly demonstrate the issue? That way, we can publish on our end to see what's happening. It can be tough to troubleshoot blind
fauzihasnan Posted September 7, 2012 Author Posted September 7, 2012 the link to my files are here. u can download off dropbox https://www.dropbox.com/s/it8gf2ogazyxtmm/flash.zip the total file is 1.8mb, it was too big so i couldnt attach it straight here:/ It would be awesome u could help me solve it. im such a noob at this. THANKS again!!!
fauzihasnan Posted September 7, 2012 Author Posted September 7, 2012 btw, test.fla is the main file im working on:)
GreenSock Posted September 7, 2012 Posted September 7, 2012 The problem is that your subloading swf has a width/height of 0 when it first loads which messes up the automatic resizing. Zero times any factor is always zero. You could solve this by using an ENTER_FRAME to keep checking the rawContent to see when its width (and/or height) is no longer zero and then set the content's fitWidth and fitHeight, like this: import com.greensock.*; import com.greensock.loading.*; import com.greensock.events.*; import flash.events.Event; var loader:SWFLoader = new SWFLoader("livingroomout.swf", {container:this, onInit:initHandler}); loader.load(); function initHandler(event:LoaderEvent):void { addEventListener(Event.ENTER_FRAME, checkResize, false, 0, true); checkResize(null); } function checkResize(event:Event):void { if (loader.rawContent.width != 0) { loader.content.fitWidth = 200; loader.content.fitHeight = 100; removeEventListener(Event.ENTER_FRAME, checkResize); } } 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now