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

graphics in as3

New Here ,
May 01, 2009 May 01, 2009

Copy link to clipboard

Copied

Hello Forum

I'm thinking of creating a visual template of a movieClips in an .fla file for the designer to adjust and tweak.  Then in flex builder 3 (actionscript project) I load in that .swf file and use the references to the movieClips to adjust location, size and color of objects...  Hope that made sense...

Along those lines... is it possible to grab the graphic information of an entire movieClip?  Let's say there's a movieClip with a red 4 pixel line on the top then 2 pixels further down there's a grey rectangle that's 400 pixels high.  These were drawn with vectors in the flash environment.  Does as3 have any way of reading this information? 

I guess I'm looking for something like the old duplicate movieClip functionality in as1.

Any insight would be much appreciated.

Thank you.

sk

TOPICS
ActionScript

Views

791

Translate

Translate

Report

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

correct answers 1 Correct answer

LEGEND , May 01, 2009 May 01, 2009

In the FLA publishing settings, under Flash, you can have it export a SWC too, which will be a SWC of everything in the Library. Take that SWC into your FB project library, and after that you should have access to the shared FLA/SWC Library items.

Votes

Translate

Translate
LEGEND ,
May 01, 2009 May 01, 2009

Copy link to clipboard

Copied

Without the different parts being symbols, it might be a little hard to measure the sizes of things. But if all you want to do is have more than one copy of the movieclip, have your designers get Properties on the movieclip in their library, and click the Export for Actionscript box, and give the Class an easy to remember name. Say it's an information panel, perhaps it would have the Class named as InfoPanel. Then in your AS3 code you can say:

var aPanel:InfoPanel = new InfoPanel();

addChild(aPanel);

You can do that as many times as you like. It's not really like AS1's duplicateMovieclip, but it's quite like as1's attachMovie.

Votes

Translate

Translate

Report

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
New Here ,
May 01, 2009 May 01, 2009

Copy link to clipboard

Copied

Thanks Colin.

This method won't work though if I develop the actionscript project in Flex Builder and load in the .swf file with all the design assets...  Won't I get errors because the infoPanel.as file doesn't really exist and Flex Builder  won't know about it until it loads in the .swf file?

Thanks

sk

Votes

Translate

Translate

Report

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
LEGEND ,
May 01, 2009 May 01, 2009

Copy link to clipboard

Copied

In the FLA publishing settings, under Flash, you can have it export a SWC too, which will be a SWC of everything in the Library. Take that SWC into your FB project library, and after that you should have access to the shared FLA/SWC Library items.

Votes

Translate

Translate

Report

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
New Here ,
May 01, 2009 May 01, 2009

Copy link to clipboard

Copied

that sounds great!  I'll give it a try.  Thank you.

sk

Votes

Translate

Translate

Report

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
New Here ,
May 01, 2009 May 01, 2009

Copy link to clipboard

Copied

Oh man that worked!!!

I love as3 and flex builder... can't believe I was holding onto as2 for so long...

Thank you again...

sk

Votes

Translate

Translate

Report

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
New Here ,
May 04, 2009 May 04, 2009

Copy link to clipboard

Copied

LATEST

Hello again...

I have a follow up question regarding the infoPanel example in the previous answer.

What if the infoPanel contains a few movieClips, let's say headerText1, headerText2 and headerText3.

Before the infoPanel gets drawn to the stage I'd like to turn off headerText2 and 3.

Now I could do this the following way (this works):

-----------------------------------------------------

var aPanel:InfoPanel = new InfoPanel();

aPanel.headerText2.alpha = 0;

aPanel.headerText3.alpha = 0;

addChild(aPanel);

-----------------------------------------------------

But the problem is that my inititation process is slightly more cumbersome.  Is it possible to wrap all this initiation into the InfoPanel class? 

I created manually a InfoPanel.as class but the problem is InfoPanel.as doesn't know of the existence of the headerTxt movieClips...

-----------------------------------------------------

package
{
    import flash.display.MovieClip;

    public class InfoPanel extends MovieClip
    {
        public var headerTxt1: MovieClip;
        public var headerTxt2: MovieClip;
        public var headerTxt3: MovieClip;
       
       
        public function InfoPanel()
        {
            this.headerTxt2.alpha = 0;                    //this doesn't work since these MovieClips have been created manually in Flash...
            this.headerTxt3.alpha = 0;
        }
       
    }
}

-----------------------------------------------------

Votes

Translate

Translate

Report

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