Skip navigation
Currently Being Moderated

statement explaination needed please

May 7, 2012 6:30 PM

Tags: #flash_cs5.5 #as2.0

I'm trying to track down a variable bug using traces (AS2.0).  Could someone please explain to me what the statement in red below means and where I should look for it ? there seems to be another addressing concept that I'm missing.

scrolledMC is a MC container that holds the dynamic text field (auto sized) that is the text that is being scrolled.

 

scrollContent1 = _parent.scrolledMC  // this statement does "_parent" refer to the original Lib item or the MC in which

trace("scrollContent1 ="+ scrollContent1)

//trace result

// scrollContent1 = _level0.instance703.instance709.scrolledMC // what does this mean? "instance" of what ? what relevance to the numbers have ?

 

1. how do I display the contents of "_level0.instance703.instance709.scrolledMC"  in a text contents form I can read??

2. Everytime this trace runs the "instance" numbers are different. never the same numbers. so if I try to trace (_level0.instance703.instance709.scrolledMC) it comes back undefined.  these numbers can get vary large the longer the swf runs and i keep coming back to the page with all the traces. Whats up with that ??

3. How is _level0 different from _root ?

4 if I trace scrolledMC I get "undefined"

 

Thanks

 

Joel

 
Replies
  • Currently Being Moderated
    May 7, 2012 7:11 PM   in reply to jdhughen

    It could be easier to explain if you explain what you have created that involves scrolledMC.

     

    The trace statement appears to be getting made from inside some object and is targeting whatever the _parent of that object is to get at scrolledMC.  So scrolledMC and that object share the same _parent.   Based on the output, it appears scrolledMC is living a couple of objects deep off of the main timeline.  As far as what those instances are, they are whatever you have scrolledMC being planted in.

     

    Generally, "instance"s are the names given to objects by Flash that you create dynamically or do not assign instance names to.  Anything you create dynamically is numbered automatically, so the numbers can grow higher.

     

    how _root is different from _level0... see if reading thru the following helps, or try searching Google for more explanations  http://www.allinterview.com/showanswers/27769.html.  Response 5 might be the more thorough explanation

     

    If you trace scrolledMC and get undefined, it is out of scope in that trace.

     
    |
    Mark as:
  • Currently Being Moderated
    May 8, 2012 4:45 AM   in reply to jdhughen

    As I already said, the "instance"s are the unnamed parts of where scrolledMC lives.  You just said... ""scrolledMC" is the part of Text_scroller", so those instances you wonder about are the other parts of it that contain it... they are not named manually, so the program assigns them generic names.

     

    Yes, they are once again attempting to make the forums better (failing again as well).

     
    |
    Mark as:
  • Currently Being Moderated
    May 8, 2012 5:21 AM   in reply to jdhughen

    Not that it will be of any consolation, but here's a couple of things you can check for...

     

    1) Right click the object that contains the scroledMC in the library and select "Linkage" in the menu.    If the object is being added dynamically, this is the most likely place to find the Identifier that is being used to call it in using code.

     

    2) You might be able to use the Movie Explorer to find all the code elements in the file (I don't know if it works for older versions)... choose Window -> Movie Explorer (or ALT + F3)

     

    One unfortunate aspect of AS1/AS2 files is that they allow code to be attached to objects, very effectively hiding it.  This often makes it very difficult to find all of the code.  You may need to click on anything that is planted on the stage to try to find it, including child objects.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points