Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old May 15th, 2008, 10:34 AM
Newbie
 
Join Date: Jan 2007
Posts: 1
Default Need solution for Action script 3

Hi Dear's,

I need sulotions for this script.

I am using CS3 Profissional software version 9.

now i am learning AS3 from flash help, first time i am creating one script is

myButton.addEventListener(MouseEvent.CLICK, testscript);
function testscript(event:MouseEvent)
{
trace("My Name is alamraman");
}

that button Instance Name is myButton.


in that Actionscript coming error. any one help me to run the script.

bye
Ram
Reply
  #2  
Old August 19th, 2008, 09:01 PM
Newbie
 
Join Date: Jul 2008
Posts: 22
Default

what error message are you getting?
Reply
  #3  
Old August 23rd, 2008, 06:29 PM
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Age: 22
Posts: 2,790
Default

Hi.

Shouldn't that be:
Expand|Select|Wrap|Line Numbers
  1. myButton.addEventListener("click", testscript);
  2.  
Edit:
Nope, as it turns out they both work fine.
I tried your code and it worked perfectly.

Are you sure you have named your button correctly?
Note that it is not enough to simply name the button in the "Convert to symbol" dialog (F8), you have to click it on the screen and fill out the <Instance name> box.
Reply
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles