Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Help

Guest
Nov 03, 2014 Nov 03, 2014

Hello All,

I have been brainstorming and reading up materials on the internet, regarding the Display List in Flash. Among others I read this article Display list programming in ActionScript 3 | Adobe Developer Connection and found it pretty comprehensive and easy to undestand. I also read this The Display List, The Stage, and "addChild" in Flash CS3.

I am writing because I wanted to get this straight in my mind., and to get somesort of a confirmation that my understanding is, or is not correct.

1. The way I understand it is that the stage is the topmost container in a Flash movie, it contains all Display Objects that are added to the movie. It is also at the top of the Display List hierarchy.

2. Every Flash Movie whether or not it has a document class associated with it or all code is written on the timeline, when ran has a class assigned to it, which extends MovieClip and is always a Display Object which is assigned to the stage as a child. This is the maintimeline. This effectively classifies the maintimeline as a DisplayObject or Display Object Container (anotherwords an abstract class that cannot have functions and methods such as restart(); called back to it from inside MovieClips, even though the maintimeline is a parent of these MovieClips it throws an error.)

My main concern here is understanding for the moment the Display List, and its hierarchy, also I have been on the case now for 2 weeks trying to figure out what the Timeline is. If its a MovieClip then why would it throw an error when trying to refer from inside a MovieClipback to the maintimeline, in order to call a function on the maintimeline. I was told that the parent property always returns a DisplayObjectContainer, and since I read about abstract classes my understanding was that because it returns a DisplayObjectContainer it cannot have these functions assigned to it.

Thank you

TOPICS
ActionScript
117
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 03, 2014 Nov 03, 2014
LATEST

most of that is correct, but:

1. the main timeline can be a sprite or a movieclip.  if you add code to the main timeline (or any child of the main timeline), the main timeline/document class must be/extend a movieclip.

2. the flash compiler is dumb.  (actually, it may intentionally ignorant because flash pro engineers decided to make it 'forgetful' to save resources).  eg, if the parent of mc1 is a movieclip, the compiler might complain if you use something like:

mc1.parent.dynamic_property = 3;  // error: access to undefined property (dynamic_property) through a reference to a displayobject

but if you tell (by explicitly casting mc.parent) the compiler that mc1.parent is a movieclip, all's well:

MovieClip(mc.parent).dyamic_propety = 3;  // no error

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines