Tuesday, December 6, 2011

Where is 'on click' action?

Am working in Flash 8 Prof. In Flash MX it was easy to add an
'onclick- go to frame' action to a button. Where are these
functions in Flash 8?Where is 'on click' action?
same place - same method



attach to button:

on(release){

gotoAndPlay(x);

}



or attach to frame:



button.onRelease = function(){

gotoAndPlay(x);

}



You can change onRelease to onPress - not onClickWhere is 'on click' action?
%26gt; same place - same method



Indeed. Hasn't changed a bit.



%26gt; attach to button:

%26gt; on(release){

%26gt; gotoAndPlay(x);

%26gt; }

%26gt;

%26gt; or attach to frame:

%26gt;

%26gt; button.onRelease = function(){

%26gt; gotoAndPlay(x);

%26gt; }



Bingo. I would only add ... if you go the second route
(happens to be

my preference), you'll need to give your button (or whatever
object) an

instance name. In the above sample, ''button'' is that instance
name.



%26gt; You can change onRelease to onPress - not onClick



The full list of events depends on the object in question.
Fortunately,

the ActionScript 2.0 Language Reference is very closely
organized around

classes. The Button class defines button symbols; the
MovieClip class

defines movie clip symbols. Look up the event summary under
either one of

those to see what your choices are.





David Stiller

Adobe Community Expert

Dev blog,
http://www.quip.net/blog/

''Luck is the residue of good design.''






Am in 'actions' - can anyone navigate me to the 'on(release)'
etc functions?



Thanks.
Sounds like you are talking about Script Assist. In your
Actions panel, there's a button at the top for it. Is this what you
are talking about?



Otherwise, by typing the code that Nickels55 and David
recommended, you'd accomplish the same thing.
Thanks for your help. Indeed, I can type it in, but I used to
be able to find the 'onclick' 'onrelease' functions in MX, I think,
in 'global functions'. Are they still there? A window used to come
up with onclick/onpress/onrelease options for button
actions.
Hi, that's what the Script Assist is. It's not automatic
anymore.
I realise I'm being utterly thick here, but how do I get
'script assist' assist me?
Open the Actions window. Using one's eyes, locate the words
''Script Assist'' and click on it.



If you still can't figure it out, then do what you could have
done in the first place: use Flash's Help files. Sorry to be
slightly rude, but usually the rudimentary stuff can be answered
much more quickly by checking the Help files, rather than posting
online and waiting days for an answer. Flash has excellent Help
files and quite excellent Tutorials that come with the
program.
I've already apologised for being thick! Obviously, I tried
Flash help first, but found it confusing. I'll just copy and paste
actions that I need in future. Thanks for all attempts to
help.

No comments:

Post a Comment