Groups | Blog | Home
all groups > flash actionscript > september 2007 >

flash actionscript : button function doesn't work - flash8


Ahjin
9/12/2007 7:15:52 PM
Hi,

I'm using Flash professional 8 and I would like to create a component button
in the actionscript instead of dragging a button into a stage. As long as I
know, I have to use a "button" type instance to use "uploadMovie" function not
"movieclip". In addition, I mainly do a project in a way to create one fla file
and many classes(.as) . I don't use keyframes at all. So, what I tried to do is
to write scripts like this:


--------------------------------------------------------------------------------
------------
import mx.controls.Button;

var button1;
button1.createObject("Button", "button1", 100);

--------------------------------------------------------------------------------
------------

This script has no error but as I test the file, I can't see any button on the
screen.
Q1. Is there missing script?
Q2. Can I use such script in the actionscript file(.as)? Is there any
difference between .fla and .as if I use the script to each of both?

Thank you so much :smile;


benparer NO[at]SPAM gmail.com
9/26/2007 7:56:04 AM
Im finding your question a little confusing but it seems to me that
you have created the button its just empty. You either have to draw it
with actionscript, to attach a library element or load an external
image/swf.
AddThis Social Bookmark Button