A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: How to autosize a externally loaded swf

  1. #1
    Senior Member gkbdave's Avatar
    Join Date
    Nov 2000
    Location
    Fort Bragg, NC
    Posts
    304

    How to autosize a externally loaded swf

    How do you change the size of a externally loaded swf into a container movie clip?

    What I have is a swf that i am loading into a container in anohter movie, however the loaded swf is larger than my container. I want to load this into the container but it remains the same as its original size

    Is there a way to make it resize?

  2. #2
    Banned NTD's Avatar
    Join Date
    Feb 2004
    Posts
    3,438
    Hi,

    This method allows you to load a movie to the size and postion of your choice.Paste this onto the first frame of a test movie.....

    code:

    _root.onLoad = function() {
    _root.loaded = true;
    }
    this.onEnterFrame = function() {
    if (_root.loaded == true) {
    return;
    }
    if (_root.container._width>0) {
    with (_root.container) {
    _x = 100;
    _y = 100;
    _width = 100;
    _height = 100;
    }
    _root.loaded = true;
    delete this.onEnterFrame;
    }
    }
    myButton.onRelease = function() {
    _root.loaded = false;
    _root.container.loadMovie("Sunset.swf");
    }



    NTD

  3. #3
    Senior Member gkbdave's Avatar
    Join Date
    Nov 2000
    Location
    Fort Bragg, NC
    Posts
    304
    Hey thanks.. This worked great..

    Now if I can figure out how to auto scroll dynamically loaded text into this.. I have seen some news ticker stuff but not what I need..
    simple stuff..

    Any ideas??

    thanks again

  4. #4
    Banned NTD's Avatar
    Join Date
    Feb 2004
    Posts
    3,438
    Hi,

    Horizontal or vertical scrolling? Either/or...... you can put a dynamic textfield inside a movieclip and manipulate the movieclips _x or _y position. You could also use a mask to only reveal the part of the scrolling text that you want. One thing to remember, when putting a dynamic textfield into a movieclip that has a property manipulated, the font outline for the textfield needs to be embedded for the text to show up.

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