My first AS3 critter, aside from my early MVC testbeds, turned out to be a Flickr gallery.

No point in belaboring what everyone has said about AS3.

However.

I think it’s really interesting that asset sharing across CS3/CS4 and the MXMLC / FDT environments is,

so left-in-the-dark.

There turned out to be a number of nifty ways one could co-create with Flash 8 and MTASC, sharing assets.

Now, with SWCs and whatnot, you would think integration would be tighter, easier.

It just doesn’t seem so.

Let’s take the example of the humble On_The_Stage_In_The_IDE  Sprite, holmes_mc sitting in the IDE.

In the IDE, Sanjiv Actionscript has access to holmes_mc, and can do nifty things like : var mymc:Sprite = holmes_mc.

Now, in MXMLC, we use the tag to get physical stuff, jammed into the swf.

CS3 really doesn’t like classes that go about things that way; by MIRACLE CS4 actually comprende embede.

bottom line ? this hack doesn’t seem modular. it does work;

var myLogo;

try {

myLogo = new LogoMcMXMLC();

addChild(myLogo);

checkIfContained(this, myLogo);

} catch (e) {

trace(‘CATCH : sprite instance error -> ‘ + e);

myLogo = new LogoMcIde();

addChild(myLogo);

}

trace(‘ myLogo -> ‘ + myLogo);

and here’s the asset classes.

 public class LogoMcMXMLC extends Sprite {

 

//[Embed(source="/../deploy/image.jpg")]

//private var ImageMc : Class;

 

[Embed(source="/../deploy/zzz_logo__asset_00.swf", symbol="libraryclips.LogoMcIde")]

private var AssetMc : Class;

 

//

public function LogoMcMXMLC() {

init();

}

 

function init() {

//var myPhoto : DisplayObject = DisplayObject(new ImageMc());

//addChild(myPhoto);

//

var myLib : DisplayObject = DisplayObject(new AssetMc());

addChild(myLib);

myLib.x = 0;

myLib.y = 0;

}

}

//

// THE IDE CLASS BELOW

package libraryclips {

import flash.display.Sprite;

 

/**

* @author mobile1

*/

public class LogoMcIde extends Sprite {

 

public function LogoMcIde() {

}

}

}

Leave a Reply