PDA

View Full Version : Is it possible to have a movie clip thats loaded from the library go full screen.


dwayneneckles
09-03-2008, 10:40 PM
Is it possible to have a movie clip thats loaded from the library go full browser I mean.
Here is my thinking:

1. stage.addEventListener(Event.RESIZE,resizeHandler)

2. call the resizeHandler(null) function

3. function resizeHandler (event:Event):void {
loadedclip.width = stage.width // this cannot happen yet as its not loaded
}

So how would you get around it?
I hope this is clear

dwayneneckles
09-04-2008, 11:27 AM
Sorry I wasnt clear..

Yes I can set the size when its completely loaded, but what I was asking for goes one step further

to wanting to keep the loaded clip the same size as the browser when its resized?

to do that, I know I'd need to set the resize function like the way I have in my previous email,

but would I need to rewrite the resize function to include the newly loaded clip?

or is there another way around it..

On Wed, Sep 3, 2008 at 6:53 PM, Bob Wohl wrote:

use the loader class and listen to the events:
var request:URLRequest = new URLRequest("content.swf");
var loader:Loader = new Loader();

loader.contentLoaderInfo.addEventListener(Progress Event.PROGRESS,
loadProgress);
loader.contentLoaderInfo.addEventListener(Event.CO MPLETE, 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");
//SET SIZE HERE!
}

loader.load(request);
addChild(loader);

Hope that's what you were asking!
B.

dwayneneckles
09-04-2008, 03:45 PM
Is my question that hard to answer or am I not clear?