Jump to content
Search Community

Resize loader container and keep the set properties. HELP!

junky test
Moderator Tag

Recommended Posts

I have several images and videos that are loaded in my loaderMax. And I have an stage resize event, but I'm trying to figure out how to target the loaders or the movieclips that contain the image or video, but still keep the settings or proportions I originally set. Does that make sense?

 

For example say I have:

var mc:MovieClip = new MovieClip()

addChild(mc)

var video2:VideoLoader = new VideoLoader("woman.f4v", {name:"myVideo", y:300, container:mc, width:1200, height:720, scaleMode:"proportionalOutside"});

 

in my stage event listener I would want to resize the video but keep the scaleMode and different parameters.

mc.width = stage.stageWidth

mc.height = stage.stageHeight

 

Is there a way to target the loader and not the "mc"?

 

Thanks in advance.

Link to comment
Share on other sites

  • 2 weeks later...

You can use the ContentDisplay's fitWidth and fitHeight properties for that. Remember, VideoLoader, SWFLoader, and ImageLoader always create a ContentDisplay Sprite that serves as a container for the raw content that gets loaded. You can access it through the loader's "content" property. Like

 

video2.content.fitWidth = stage.stageWidth;
video2.content.fitHeight = stage.stageHeight;

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...