Topic: button hit Pages that link to <a href="https://ozoneasylum.com/backlink?for=11435" title="Pages that link to Topic: button hit" rel="nofollow" >Topic: button hit\

 
Author Thread
derketa
Bipolar (III) Inmate

From: Ankara, Turkey
Insane since: Aug 2000

IP logged posted posted 08-09-2003 13:17 Edit Quote

Hi there,

I am very new on flash action scripts. I am tryin to make a very simple thing, but i can not succeed.
I think it is so simple that i could not find the answer anywhere.

I am just trying to load a swf from a button.

I could not place the action script on the "hit" event of the button, mx does not let ans says
"current selection can not have actions applied to it".
why could this be?

thanks a lot.



mas
Paranoid (IV) Inmate

From: the space between us
Insane since: Sep 2002

IP logged posted posted 08-09-2003 18:56 Edit Quote

sorry derketa, i cant give you an answer, but one thread below this one, fig posted a link to a pretty niftay flash forum. try to ask there too.

PORTFOLIO0

Dracusis
Maniac (V) Inmate

From: Brisbane, Australia
Insane since: Apr 2001

IP logged posted posted 08-09-2003 23:46 Edit Quote

Hey derketa, that's a commom mistake for beginner actionscripters. It takes a bit to work out where you should be putting your scripts. Steve has written a super tutorial over at the Guru's Network on this very issue and I highly recommend you read through it.

But to save you from the immediate fustration, the scripts for button actions should be placed on the instance of the button itself, not inside the button on one of the frames. This is why flash was telling you that scripts can't be placed where you were trying to place them -- because their not meant to go there. I know it seems logical that's where you would put them, but once you gain a deeper understanding of actionscript you'll understand why scripts shouldn't be put there.

Anyways, simply select the button from it's containing timeline (also known as the parent movie clip) then bring up the actionscript panel and enter the script there. Just remember, you'll need to specify an event for your script like:

on(event) {
do this
}

where event is the mouse event you want to the button to watch for and do this is the code you want to execute when that event is triggered. Dead easy once you get the hang of it all.

Edit: Botched the guru's link... all fixed now. =)



[This message has been edited by Dracusis (edited 08-09-2003).]

derketa
Bipolar (III) Inmate

From: Ankara, Turkey
Insane since: Aug 2000

IP logged posted posted 08-11-2003 17:28 Edit Quote

all clear now,
thanks a lot.



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu