A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: targeting questions

  1. #1
    Senior Member
    Join Date
    Jan 2002
    Posts
    161

    targeting questions

    Hello fk.

    I have some quick questions about actionscript.

    I am trying to load jpegs into a movie clip "container", using LoadMovie, so that they are centered always.
    Right now I have made the "container" moveclip (lets call it container_mc) 410x410 using a square movie clip at alpha 0%.
    I would like the size of this container_mc to have the ability to be changed in size to adapt to my site changes.
    The jpegs will themselves be various in size.

    Any insight. Also, I'm not sure how to target something that is within another movie clip if it is content that is changed by the user, such as images.

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    The container clip will adapt its size to whatever is loaded into it. However the image you load will take over the movieclip completely, it will replace everything in it.
    So normally you use two clips. One container clip and a "frame" clip that will resize to whatever the size the container clip has. For instance....

    // On FRAME movieclip
    onClipEvent(enterFrame){
    this._height=_root.container._height;
    this._width=_root.container._width;
    this._x=_root.container._x;
    this._y=_root.container._y;
    }

    This simple example will make the frame movieclip always have the same dimensions and position as the container clip.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center