Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7550095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:07:31+00:00 2026-05-30T10:07:31+00:00

When coding in the Flash IDE, i very often use the following procedure to

  • 0

When coding in the Flash IDE, i very often use the following procedure to create specialized versions of MovieClip classes:

I design my object in the IDE, for example, i add two buttons and give them the instance names “btn1” and “btn2”. Then i select them together and convert them to a symbol. I then select Export for ActionScript and give them a classname, let’s say “MyClass”.

Then I go and write a specialized MyClass.as for it, like this:

public class MyClass extends MovieClip{
    private var _button1:Button;
    private var _button2:Button;

    public function MyClass(){
        this.addEventListener(Event.ADDED_TO_STAGE, init);
        ....
    }

    private function init(e:Event){
        _button1 = this["btn1"];
        _button2 = this["btn2"];
    }

    ...
}

(ps: i know that i wouldn’t have to assign the values to the private variables _button1 and _button2 and instead could directly make calls to btn1, but I like to use only Typesafe variables in my code)

This works very well in Flash IDE. when I create a new instance of MyClass() it will contain all the elements that i positioned in the Flash IDE when defining the Symbol. This is very convenient and straight forward.

Now I want to do the same in FlashBuilder.

For this i designed the MyClass Symbol as before in Flash IDE, gave it the classname MyClass and then select the library symbol and export it to MyClass.SWC

In Flash Builder i add MyClass.SWC to the buildpath and I write a MyClass.as with the same code as in the Flash IDE example. but this time, the code won’t work. on

_button1 = this["btn1"];

i will get an Error #1069 stating that “btn1” was not defined.

So – how to do this properly if developing with Flash Builder?

PS: i use the default package in Flash IDE when setting the Classname for the symbol as well as in FlashBuilder for the as file

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T10:07:32+00:00Added an answer on May 30, 2026 at 10:07 am

    Might I suggest that now you are moving to Flash Builder that you change your approach slightly. Although there is nothing wrong with using a swc, your assets are embedded at compile time, which means you need to recompile your app if you change them.

    I have been using an approach of putting movieclips in a swf and loading it in, and then to keep the type safety that you describe I use the IMediaLibrary approach. See the following article:

    Runtime Class Extraction

    Doing it this way means you can also share this swf with other applications, it may contain icons or whatever you want, but I think you will find the approach very flexible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our coding standards ask that we minimise the use of C# var (suggests limiting
I'm currently coding counter system and have spotted one problem with flash banners without
I am learning how to use Flash using CS4, and focusing mainly on ActionScript3
The ide i am using is flash cs3. the as2 swf contains a tween
I'm a Flex developer who had to do some coding in Flash, so my
We need to create a flash application, where there would be a menu page.
I'm coding a simple Flash game, just to learn flash and improve my maths,
I am coding a simple movie timeline in Flash CS5 actionscript 3.0. I have
inserting a .swf or flash files in visual basic asp.net give me coding sample
I need to use iPhone Flash light in my app. But, while the user

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.