[mtasc] Re: little player

victor vdaigu at gmail.com
Tue Jan 2 23:03:43 CET 2007


Ok, using examples I've tried this code:

FOR swfmill

<?xml version="1.0" encoding="iso-8859-1" ?>
>
> <movie width="800" height="600" framerate="12">
>   <background color="#ffffff"/>
>     <frame>
>       <library>
>         <clip id="myPic" import="aaa.jpg"/>
>             <sound id="mySound" import="aaa.mp3"/>
>       </library>
>     </frame>
> </movie>
>
there I have first problem.
 swfmill simple test.xml out.swf
using swf2xml option I can see that aaa.jpg is injected but not the sound,
aaa.mp3 (is  mono with 128 bit-rate)

After, using MTASC

// test.as
> class Test extends MovieClip
> {
>     function Test(target)
>     {
>         _root.createTextField( "fooText", 2, 10, 10, 200, 40
> );
>         _root.fooText.text = "init";
>
>         Object.registerClass ("myPic", MovieClip );
>
>         target.__proto__ = this.__proto__;
>         target.__constructor__ = Test;
>         this = target;
>
>         _root.attachMovie ("myPic", "myPicVar", 1);
>         _root.myPicVar._x = 1;
>         _root.myPicVar._y = 50;
>
>             var snd:Sound = new Sound();
>             snd.attachSound("mySound");
>             snd.start();
>
>             }
>
>
>
>     static function main ()
>     {
>         // assimilate _root
>         var TestInstance:Test = new Test( _root );
>         _root.myPicVar.onPress = function(success)
>         {
>             _root.fooText.text = "clicked!";
>         }
>
>         _root.myPicVar.onRollOver = function(success)
>         {
>             _root.fooText.text = "over";
>         }
>         _root.myPicVar.onRelease = function(success)
>         {
>             _root.fooText.text = "released";
>             var tmp = new Test();
>
>         }
>         _root.myPicVar.onRollOut = function(success)
>         {
>             _root.fooText.text = "Out";
>         }
>     }
> }
>

With command line:
 mtasc -v -swf out.swf -main test.as

it produce out.swf. The graphics features work fine, but not sound (only
because swfmill dont inject sound)

Two question:

-Why swfmill don't word with sound?
- is test.as fine?

Thanks


2007/1/2, victor <vdaigu at gmail.com>:
>
> Hello,
>
> after to see the power of mtasc:
>
> http://www.cartoonnetwork.com/games/action/reanimated/fittobepied/index.html
>
> I supose, it whould be easy to do:
>
> - I have three url's looking to some place in internet, with: a clip of
> sound mp3, a pic  with a play button and other for stop, in gif or jpg. I'd
> like create a swf that show this two butttons, and work like a player, for
> play the mp3.
>
> can Some one  help me to do that? using only mtasc, is it possible?
>
> Thanks!
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.motion-twin.com/pipermail/mtasc/attachments/20070102/bae8cd95/attachment.htm


More information about the mtasc mailing list