A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Change document dimensions based on movieclip

  1. #1
    Junior Member
    Join Date
    Dec 2007
    Posts
    15

    Change document dimensions based on movieclip

    Hi There. This must be a simple one, as I dont see anyone else having this problem.

    I would like to dynamically change the height of my flash document based on the height of a movie clip, but keep the movie clip size as it is. My keyframe's as3 looks something like this:

    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.events.Event;
    import library.News;

    latestNews = new News();
    addChild(latestNews);

    StageSettings();

    function StageSettings()
    {
    stage.scaleMode = StageScaleMode.NO_SCALE;
    stage.align = StageAlign.TOP_LEFT;
    }


    .. and in the News class Im just creating some text in a movie clip. Problem is that when I want to rescale the document's height to make all the news visible, if I call:

    this.height = MyMovieClip.height;

    everything scale, but the document. If I call:

    stage.height = MyMovieClip.height;

    I get an error that stage does not support that property.

    I also tried:

    stage.stageHeight = MyMovieClip.height;

    but nothing changes visually. The document's height stays the same.


    I assume there must be a call that allows me to keep the movieclip scale but just change the flash document dimensions?
    thanks in advance
    Last edited by Litow; 12-18-2007 at 09:13 AM.

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    You cannot change the stage size. Height and width are read-only properties. You would have to change your browser settings in the html as well.
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Junior Member
    Join Date
    Dec 2007
    Posts
    15

    [RESOLVED] Change document dimensions based on movieclip

    That is what I thought after reading a few sites.
    Thank you for the feedback, appreciated.

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