all groups > flash actionscript > january 2004 >
You're in the

flash actionscript

group:

Apply actions to static text?



Apply actions to static text? Knight Miniatures
1/18/2004 5:00:57 PM
flash actionscript: I have a situation where various static text objects need to be clickable to implement gotoAndStop actions. The Properties panel only has a field for specifying URL. (Can actions be placed here? I think not...) I'd rather not make each clickable object a library symbol, and the only other thing I can think of is placing a clickable movie clip object behind each piece of text and adding actions to the clip. Is there some other way of attaching a gotoAndStop action to static text?

Re:Apply actions to static text? kglad
1/18/2004 6:31:44 PM
you can convert it into a movieclip (right click, convert to symbol/movieclip) and then do all the things to it that you would do to a movieclip including assigning button actions

Re:Apply actions to static text? Knight Miniatures
1/18/2004 6:49:13 PM
Like I said, I was hoping to avoid turning each piece of clickable text into a symbol, but alas, it's looking as though that's going to be my best option.

Re: Apply actions to static text? Knight Miniatures
1/18/2004 8:39:41 PM
Prefect. This is exactly what I was looking for. (Evidently I haven't gotten to the asfunction action in my readings yet.) Tried two approaches to experiment and found one that works.

asfunction:gotoAndStop("thisFrame")
This does not work. I was thinking I might save a function definition by putting the goto call right in the box. No such luck.

asfunction:gotoFrame("thisFrame")
This does work. The gotoFrame function is coded to accept either an integer or a string parameter.

Thanks for the tip. (Any ideas why my Key object is misbehaving?)

Re: Apply actions to static text? urami_
1/19/2004 3:45:04 AM

[quoted text, click to view]


that's what Asfunction is for , the URl box is just a name of the box, it does not limit
Text Block to link to anywhere within the stage or kick of function or do any other
actions ...

help - Using Flash - click search and type "asfunction"

on timeline frame function

function MyFunc(){
trace ("You clicked me");
}

Highlight part of text you like to be a link and go to text properties than
type in the url box asfunction:Myfunc

The text will be underline in authoring , to show you what part of it is a link.







Regards


urami_*

<xmas>
http://flashfugitive.com/
Re: Apply actions to static text? urami_
1/19/2004 11:37:09 AM

[quoted text, click to view]

for as function there always must be function on timeline frame than the actual link only call the function.
It was develop to allow us controlling movies from dynamic text , many clients like to do updates themselves
so we could define function and than pass parameters in real time with the text click .
ANyway , flash compile all the actionscript upon export, just like .AS files , that's why we need the function
to be on timeline first than we can call it . We can't make function dynamically.
SO as long as you define function on timeline and use text to kick it off it will work like charm.




Regards


urami_*

<xmas>
http://flashfugitive.com/
Re: Apply actions to static text? Knight Miniatures
1/19/2004 2:20:31 PM
Actually, I found a way to make it work.

asfunction:theClip.gotoAndStop, theFrame

(Parameters for the invoked function follow the function name separated by commas, not within parentheses as I was doing.)

Re: Apply actions to static text? Jeckyl
1/23/2004 10:28:04 AM
Not in flash .. in SWiSH any object can be made clickable and have script.

Lots of ways to get same effect .. put the text as a button or create a
button with hit-state-only (ie invisible button) and place it at the same
place as your text etc.

AddThis Social Bookmark Button