lundi 17 avril 2017

Is it possible to generate a shape in an flv file using a script?

I am starting with Adobe Flash CS3(I know it's old but bear with me).

I want to know if it is possible to generate a shape directly in the flv canvas without dragging/dropping anything, by simply running a script.

I know that I can generate it by adding a document class such as following:

package 
{
    import flash.display.*;
    import flash.geom.*;

    public class Script extends MovieClip
    {
        public function Script()
        {
            var r : Shape = new Shape();
            r.graphics.beginFill(0x00ff00);
            r.graphics.drawRect(0, 0, 50, 50);
            r.graphics.endFill();
            this.addChild(r);
        }
    }
}

But is it possible to do this directly to the .flv file immediatly with some kind of a run-once script(eg, insert an exactly 800x300 red rectangle into my current scene at x=30, y=30)?; so that it appears on the document I am currently working on without running Control>Test Movie?

If so, how can I accomplish this?

Aucun commentaire:

Enregistrer un commentaire