get _root properties?

Ask a Question related to Macromedia Flash Actionscript, Design and Development.

  1. #1

    Default get _root properties?

    Ey and thanks for reading.
    First off, I'm trying to get the _wdith and _height properties of my root most
    swf file. I know how to target a movie clip FROM the main root timeline to
    navigate down into empty_mc's or whatever the structure is at hand. However
    what I am trying to access is the root dimensions. In the project properties
    my dimensions are like 500x400. How can I trace this?

    Goofy question I know, but I'm experimenting and was curious....

    Thanks in advance,
    Noel

    yn Guest

  2. Similar Questions and Discussions

    1. _root._alpha = 0? :(
      hi i am trying to make all of the screen to go to 0 _alpha... i am loading a movie into an mc in the first frame of the loaded mc i put...
    2. How can i unload _root?
      My script looks so: on (press) {_root.othermc.music_choice1.gotoAndStop(2);} "music_choice1" - the name for movie clip which loads "othermc"...
    3. _root[whichpiece]
      hi guys i am reading a tutorial built in the flash and i am doing the "puzzle" i have there something like 60 pieces and som how it controls them...
    4. Why no onLoad or onUnload on _root?
      Subject line says it all. In other programming environments, I can interecept the "exit" call (for instance) and pop up a "Do you want to save?"...
    5. Variables in _root
      if I create a "base" movie, call it base.fla and on frame 1 I loadmovie child1.swf, then I loadmovie child2.swf, then set the variable _root.testvar...
  3. #2

    Default Re: get _root properties?

    Put this code on the first frame of the main timeline:

    trace("Stage Width: "+Stage.width+" Stage Height: "+Stage.height);
    jerreye04 Guest

  4. #3

    Default Re: get _root properties?

    neat. thank you, I never would have found that keyword! Are the properties
    dynamic? eh, Can I change them via code similar to how I would change my _mc
    properties? I've tried to type up a few lines and have not been able to get
    anything working. eh, just another point of view I suppose... anyway, thanks
    already for the help already!

    Noel

    yn Guest

  5. #4

    Default Re: get _root properties?

    your welcome...

    I don't think you can SET the width or height of the stage during runtime. You
    can only GET the info. (dimensions are taken from the HTML width and height
    properties)

    Example taken from Flash Documentation:

    Stage.scaleMode = "noScale"
    myListener = new Object();
    myListener.onResize = function () {
    trace("Stage size is now " + Stage.width + " by " + Stage.height);
    }

    Test the movie in the Flash environment, then maximize the flash window. It
    will trace the new dimensions.


    jerreye04 Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139