开发者

set movieclip-size in actionscript 2

开发者 https://www.devze.com 2023-02-02 07:13 出处:网络
i\'d like to load an external image in a movieclip via createEmptyMovieClip(..) m开发者_如何学GocName.loadMovie( imageName )

i'd like to load an external image in a movieclip via

  createEmptyMovieClip(..)
  m开发者_如何学GocName.loadMovie( imageName )

trying to set the mc-size via

  mcName._width = 100
  mcName._height = 100

nothing changes. furthermore - any possibilities to zoom or stretch the image to get the size provided from the mc?


You need to wait until the movie is done loading. You can use getBytesLoaded and getBytesTotal to make sure it's complete. Or better yet, use the MovieClipLoader class.

Once the loaded image appears on the stage, _height and _width should return the boundaries of what is visible. Unless of course, you set them to another value, which will stretch or compress the image.

0

精彩评论

暂无评论...
验证码 换一张
取 消