Using levels (edited title)

Hi, I’m using the scrollable Textbox thingy for a webpage I’m making. The problem I have is that my buttons are in a movie clip that are 1 level lower than my scrollableText box. So when I add actions to my buttons to change the scrollableText variable, what do i do? I tried.\rOn release _root.scrollableText = “blah”\rbut that didn’t work. i also tried scrollableText = “blah” that didn’t work.\rThanks\r-Jon

since you are talking about ‘levels’ i am assuming that you are using loadMovieNum.\ryou can control levels just like movie clips.\rex:\rto control level 15…\r_level15.gotoAndPlay(“level15_rules”);\rto control a movie clip on level 15…\r_level15.mcMyMovieClip.gotoAndPlay(“i_live_in_level15”);\r\r’_root’ is relative to the level that contains it. some people make the mistake of thinking that ‘_root’ and ‘_level0’ are interchangeable…they are not.\r:) \rjeremy

I’m not sure I understand.

‘_root’ is relative to the level that contains it
What’s the correct as then : _root._level1.variable or _level1._root.variable ? I always believed that it was the first one but your sentence leads me to think otherwise.\r\rpom 0]

Nope, _root.level1 makes no sense, it’s as if saying level0.level1, and you can’t be on both!\rFirst pick a level you wanna work in, then pich the clip/target. And indeed, _root will act as the base level of the clip in the level you chose, while _root by itself will be level0’s _root…this was just to confiuze all of ya, hehe

And you succeded admirably, Eyez !\rpom 0]

eyez, that is not totally correct…\r_root is the lowest level of the swf that contains the object referring to _root.\r_root by itself is NOT _level0 unless the you are referring to _root from within _level0.\r_level0 is the first swf loaded into the player, and everything loaded into _level0 is a part of _level0. if you load a movie into a target in _level0, and that clip refers to _root, then it is referring to _level0. if you load a movie into _level5, everything in that level that refers to _root is referring to _level5 - even if you load a movie into a target in _level5.\rbasically _root is relative and _level is absolute.\r:) \rjeremy

Let’s see if I get this :\rIl load my movie in level 5. If I want some data located in the _root of my main movie, that is to say level 0, I’ll have to access it with _level0. and that’s it. No _root.\r\rIs that right ?\r\rpom 0] \rI’m making this a best of Kirupa right now !! Well not right now, but when it’s finished…

that is exactly it, pom!!\ryou have to use the level when controlling variables or clips in different levels.\ras a matter of fact, flash relies solely on the level of swf’s when it ‘thinks’ about movie clips, variables, etc.\rto test this, just make a new movie in flash and put this in the first frame:\rtrace (targetPath(_root));\rthen test movie.\rin the output window, it should say ‘_level0’. now, if you made another movie that loads that movie into level 15 and tested that movie you would get ‘_level15’ in the output window, even though the trace says ‘_root’ in the targetPath.\r:) \rjeremy

This is so funny…_root, level0, main Movie, target clip…imagine a beginner reading this and pulling his hair out! Where the hell am I, in the basement, 1st floor or ceiling? Why is _root sometimes _root and sometimes level0? LOL! (I know it’s not, sinfinity, it’s just so hilarious…)

that’s the confusing thing…sometimes _root is _level0!\r:P\ri think we scared everyone away!\r:) \rjeremy