Ok, this worked out for me after a little trial and
error. I had no idea that a movie clip has all of the
button's functionality. (even though some other
sources of information said there is no substitute for
a button.) Are there any limitations to using the
movieclip instead of a true button?
Thanks.
For everyone else's benefit, here is a trivial case
that worked for me:
------------------------------------------------
// Filename: 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 = 100;
}
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";
}
_root.myPicVar.onRollOut = function(success)
{
_root.fooText.text = "Out";
}
}
}
---- test.xml: --------------------------------------
<?xml version="1.0" encoding="iso-8859-1" ?>
<movie width="800" height="600" framerate="12">
<background color="#ffffff"/>
<frame>
<library>
<clip id="myPic" import="rochester.jpg"/>
</library>
</frame>
</movie>
--- makeswf.bat -------------------------------------
"C:\Program
Files\SWFMILL\swfmill-0.2.7-win32\swfmill.exe" simple
test.xml out.swf
"c:\program files\mtasc\mtasc" -v -swf out.swf -main
test.as
pause
----------------------------------------------------
--- Johannes Nel <[EMAIL PROTECTED]> wrote:
> create a movieClip for the button and assign
> onRelease or onPress
> handlers to it. same thing as a button.
>
> On 8/14/05, Carl Vogt
> <[EMAIL PROTECTED]> wrote:
> > I've chosen to use MTASC and SWFmill for a
> commercial
> > application. (I'm avoiding the use of Flash
> Studio at
> > all costs.) I'm not using Eclipse either, I just
> want
> > a flat-out scripted compiler tool chain.
> >
> > How do I add a button in SWFmill? I'd prefer to
> do as
> > much as possible in actionscript at runtime, but
> all
> > the official documentation I've read, O'Reilly et.
> al.
> > says I can't do so. I've been all over the
> Internet,
> > and done my homework, but the only answer I get is
> > 'make your buttons in Flash Studio, then use
> MTASC.'
> > That seems to be counterproductive.
> >
> > I've tried using SWFmill to decompile and
> > reverse-engineer a button, but I'm totally lost
> based
> > on the lack of documentation for SWFmill. There
> seems
> > to be a jumble of tags for Button, createButton2,
> etc.
> >
> > Should I be using Ming instead? or at least make
> the
> > buttons in Ming and import them? I'd really like
> to
> > use the former tools.
> >
> > _______________________________________________
> > osflash mailing list
> > [email protected]
> >
>
http://osflash.org/mailman/listinfo/osflash_osflash.org
> >
>
>
> --
> j:pn
>
_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org