swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swftools-common] Really basic AS3 question


From: Richard Humphreys
Subject: Re: [Swftools-common] Really basic AS3 question
Date: Wed, 21 Oct 2009 15:56:31 +0000 (GMT)

Thank you Ricardo, that is a nice project.

I still cannot work out an answer to my original problem: How to add a swfc sprite to the stage with script. Thanks to the help that I have been given so far, that attached program now compiles without error. However it does not work, there are no sprites being added by the actionscript.

Can anyone help?

Thanks, Richard.


.flash filename="test.swf" bbox=200x200 version=9 fps=40 background="">  .box b1 10 10 color=yellow
  .circle c1 r=15 color=red

  .sprite logo
      .put b1 x=-5 y=-5
      .put c1 x=-15 y=-15
      .action:
        package
        {
        import flash.display.*
 
        public dynamic class spr extends MovieClip
        { }
        }
      .end
  .end

  .frame 1

      # This works
      .put a=logo x=30 y=30

  # However this does not work...
  .action:
    package
    {
        import flash.display.*
 
        public dynamic class MyMovie extends MovieClip
        {
            function MyMovie()
            {
                var i:int, j:int;
                var o;

                j = 1+Math.random()*10;
                for(i=0; i<j; i++)
                {
                    //o = new logo(); // does not work either...
                    o = new spr();
                    o.x = Math.random() * 10 * i;
                    o.y = Math.random() * 10 * i;
                    addChild(o);
                }
            }
        }
    }
  .end
.end


From: jean-michel.voicechat_fan <address@hidden>
To: Ricardo Pedroso <address@hidden>
Cc: swftools-common <address@hidden>
Sent: Monday, 19 October, 2009 21:34:52
Subject: Re: [Swftools-common] Really basic AS3 question

ricardo you are a king thanks a lot
package was the key to open the treasure cave
that makes swfc a very great tool now

Ricardo Pedroso a écrit :
> On Sat, Oct 17, 2009 at 9:08 AM, jean-michel.voicechat_fan
> <address@hidden> wrote:

>> hello matthias
>> i have tried to put a class syntax on the top of .action: statement
>> but i have a syntax error
>> i have just wrapped a small piece of working code
>>
>> the syntax error pointer points on the class name
>>
>> it seems like class statement  is not taken into account
>> is something missing  ?
>>
>>   
>
> I was hunting this for sometime too.
> Today I was able to make it work (tested only with
> swftools-2009-08-24-2042), see attachment.
> It's a simple test editor.
> You can change bold, italic, underline with 3 buttons or with context
> menu (mouse right click)
>
> The "magic" here is to define a dynamic class
>
> Richard and Jean, if you find other ways of doing, please let me know
>
> Hope this will be useful,
> Ricardo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]