Embeding external assets and resources

Escrito el 23/10/2005 por Xavi Beumala

Usually, applications works with assets that has nothing to be with buttons neither application components. Instead they use nicely designed items and draws.

This example shows you the new way to work with visual elements and how to bind a visual element to a Class.

package {
    import flash.display.Sprite;
    import flash.display.DisplayObject;
    import flash.events.*;

    public class ImageTest extends Sprite {
        public function ImageTest() {
            var embedObj:MyDog = new MyDog();
            addChild(embedObj);
        }
    }
    
    private class MyDog extends Sprite {
    	[Embed(source="dog.swf")]
        public var DogGraphic:Class;
        
    	public function MyDog() {
    		var dg:DisplayObject = new DogGraphic();
    		dg.scaleX *= -1.5;
    		dg.scaleY *= 1.5;
    		
    		addChild (dg);
    		addEventListener(EventType.ENTER_FRAME,onEnterFrame);
    	}
    	
    	public function onEnterFrame (event:Event) {
    		x += 1;
    	}
    }
}
Comments
El 17/12/2006 vdooger escribió:

great! thanks !

El 30/07/2007 tony escribió:

good cord. thank you

El 30/07/2007 tony escribió:

good cord. thank you

El 21/09/2007 Miguel escribió:

No quiero parecer un listillo, pero hay un error de lenguaje: has nothing to DO with buttons, no se usa el be en este caso. Está muy bien tu página.

El 15/12/2007 viagra escribió:

It's not so clear to be so sured that it's true

El 15/12/2007 cialis escribió:

Why you all thinking in a such way, people?

El 15/12/2007 levitra escribió:

I don't want to think, that a lot of people thinking in a such way.

El 15/12/2007 soma escribió:

Not so complicated to try to understand it, don't you think so?

El 15/12/2007 tramadol escribió:

Stop. Whether you think it's true or not, it's just an opinion

El 15/12/2007 ultram escribió:

Beware of first sight conclusions, often they are wrong.

El 18/02/2008 webmaster escribió:

good cord. thank you

El 4/03/2008 Greatest Real Estate Agent In The World escribió:

Good Information and great blog.

El 5/03/2008 oyun escribió:

Good Information and great blog.

El 9/03/2008 KralOyun escribió:

Great Job! Thanks

El 9/03/2008 KralOyun escribió:

Great Job! Thanks

El 9/03/2008 sadsad escribió:

sdadsa

El 10/04/2008 salope escribió:

Good Information and great blog, thanks !!! SI vous aimez les salopes, venez sur mon site vous serez comblés.

El 25/04/2008 blog escribió:

Voici un blog de rencontre, tout y est, pute, salope, suceuse de queue, webcam porno, le blog numero 1 des rencontres chaudes sur Internet.

El 25/04/2008 Coquine escribió:

J'ai beaucoup ton blog de coquines !

El 30/04/2008 webcam porno escribió:

Moi je prefere les coquines en webcam porno c'est plus direct !

El 8/05/2008 iddaa escribió:

Good Information and great blog, thanks !!! SI vous aimez les salopes, venez sur mon site vous serez comblés.

Post new comment