Okay, I'll admit I'm only getting a vague sense of your problem, so forgive
me if I'm totally off base, but I think the proper workflow is this...

1. Uncheck the "Automatically declare stage instances" checkbox. (In
"File... Publish Settings", go to the Flash tab, and click the "Settings"
button next to ActionScript 3.0) It sounds like you've already done this.

2. Create whatever you want to on stage within the Flash IDE. Remember the
name that you give it. For example, maybe you're creating a custom member of
the Ball class called "bouncyBall". And maybe you added a TextField called
"highScore"

3. Go into your Document Class ActionScript file, and make sure you have
code like this...

public class BounceApp extends Sprite {

     public var bouncyBall:Ball;
     public var highScore:TextField;

    // rest of code goes here...

4. You might need to repeat steps 2 and 3 if you've done something similar
for any individual symbols in your library. For instance, if my Ball class
had a text field called "bounceCount", I'd need to include code like this...

public class Ball extends Sprite {

      public var bounceCount:Textfield;

     // other code here

4a. The nice thing is that I could actually then create a new class that
extends Ball, and as long as it has a Text Field called "bounceCount" in
there, it should all work.

5. From experience, I can tell you this is a pain in the butt if you're
doing it for the first time on a project you've already implemented halfway,
but when you start getting into this workflow from the beginning of a
project, it becomes second nature.

Hope that helps somewhat...

--T


On Wed, Nov 5, 2008 at 4:56 PM, Glen Pike <[EMAIL PROTECTED]> wrote:

> Hi,
>
>   I found my problem...
>
>   I had created classes that extended my AppScreen class
>
>   public class ShowControlScreen extends AppScreen
>   public class RobotDiagnosticsScreen extends AppScreen
>
>   etc.
>     But the Flash IDE would not let me use the AppScreen as the Base Class
> for my Library symbol - it whines about the Base class being already
> defined???
>
>   So to workaround this problem, I had set the Base class to;
>
>        ShowControlScreen, RobotDiagnosticsScreen, etc.
>   Then set a LinkageID for each one to something else;
>         ShowControl, RobotDiagnostics, etc.
>
>   So my symbols on stage that included components were ShowControl, etc.
>     As soon as I started instanciating these instead of the Base class for
> the symbol, my on stage instances appear - hooray.
>
>   Need to get my head around this - found a useful thread here, but I am
> having the problem that if I don't declare my stage instances automatically,
> but in my classes, I get a reference error for each thing on stage when the
> system tries to create these objects in the display list;
>
> ReferenceError: Error #1056: Cannot create property _displayText on
> RobotDiagnosticsScreen
>
>   etc...
>
>   So, does anyone know what the workflow is, because this seems like a PITA
> - either I have to create everything programmatically at runtime, or do some
> frig' in Flash with my LinkageID's to get it working and risk compounding
> errors with possible typo's etc in these fields.
>
>   Why can't I just specify the class name as the LinkageID and choose WTF I
> want for the Base class - if I mess it up, that's my problem surely???
>     Thanks, from a tired p****d off Glen.
>
> Paul Andrews wrote:
>
>>
>> ----- Original Message ----- From: "Glen Pike" <[EMAIL PROTECTED]
>> >
>> To: "Flashcoders@chattyfig.figleaf.com >> Flashcoders mailing list" <
>> flashcoders@chattyfig.figleaf.com>
>> Sent: Monday, November 03, 2008 10:13 PM
>> Subject: [Flashcoders] Flash Authortime vs Runtime children
>>
>>
>> snip
>>
>>    The problem I have run into is that when I instanciate an AppScreen
>>> symbol from my library - it's not on stage - and add it to the stage I
>>> handle the ADDED_TO_STAGE event for wiring the components up.  All my
>>> component instances trace out as null at this point, so I am left scratching
>>> my head wondering when they might be added to the display list...
>>>
>>
>> I'd really like to see how you are trying to access the the component
>> instances. Instanciating the symbols alone won't add them to the stage
>> (addChild does that), so do you ever receive the event? If you do you should
>> be able to find the component from the event payload.
>>
>> If you can write a tiny snippet of code to show how you attempt to load
>> and access your components, then I'm sure we'd find the problem straight
>> away.
>>
>> Paul
>
>
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to