Topic: Stupid text links (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=28542" title="Pages that link to Topic: Stupid text links (Page 1 of 1)" rel="nofollow" >Topic: Stupid text links <span class="small">(Page 1 of 1)</span>\

 
krets
Paranoid (IV) Mad Scientist

From: Right-dead center
Insane since: Nov 2002

posted posted 10-15-2006 19:59

You're all going to laugh at me but it's been a long time since I last used Flash and I'm having a total brain cramp when it comes to something really simple:

I want to create a menu of a series of text links that trigger some AS when I click on them. However, I can't figure out how to make the text clickable! I've tried creating a button of just the text and creating a Hit state keyframe but that's not working.

What the heck am I doing? I've Googled till my eyes tear up and can't find a thing.

Sample: http://www.11oh1.net/test/solutions.html
Fla: http://www.11oh1.net/test/solutions.fla

I've only worked on the "AFO HEAT" link thus far.

:::11oh1:::

(Edited by krets on 10-15-2006 20:13)

Dracusis
Maniac (V) Inmate

From: Brisbane, Australia
Insane since: Apr 2001

posted posted 10-16-2006 12:57

What you're doing is correct, but there's a few "gotcha's" when using text in buttons with flash, and they've given many a wiser man than you brain cramps so don't stress too much over it. In short, you need to make the text non-selectable or the text selection will overide the button state and it just won't play nicely.

Firstly, I'd set the text type to static text, this will automagically embed any fonts used, secondly make the text non-selectable (that's the little black and white [A|b] button in the properties panel under the font drop-down-list), and finally, remove the text field from the hit state keyframe (you don't need it there). Remember, you'll need to make those changes for each keyframe.

krets
Paranoid (IV) Mad Scientist

From: Right-dead center
Insane since: Nov 2002

posted posted 10-16-2006 16:35

Sonofabitch, I was wondering if it was something due to that. The last version of Flash I used didn't have the option to make the text selectable at all. (Yes, it has been a while.)

Thanks Drac.

:::11oh1:::

Radical Rob
Bipolar (III) Inmate

From: Lost Angeles Kalifornia, via Hawaii....
Insane since: Jun 2001

posted posted 10-18-2006 02:30

One thing that I've gotten into the habit of doing is instead of making buttons I make all my elements movie clips.
That way you can apply actions to each one on a seperate actionscript layer. It's easier to control all the links that way.

The code I use most often when putting them on a button is this...

on(release) { getURL (" link " , "_blank");
}

That should do it.. :-)

oops, forgot to mention that the "_blank" can be replaced with ")self") to open in the same browser window.


(Edited by Radical Rob on 10-18-2006 02:31)

Dracusis
Maniac (V) Inmate

From: Brisbane, Australia
Insane since: Apr 2001

posted posted 10-18-2006 23:36

Rob, I can't see how that's any different to using buttons. Also, using MC's means you have to script events for the rollover and press states as well. Most of the time it's simpler to use buttons, as long as you don't need full timeline control within the button, there's no real difference between the two as far as actionscript is concerned.

Oh and getURL("url","target") won't work in IE7, at least the "target" paramater won't, huge bug that's been causing me uber ammounts of grief at work. Only way around it is to use a javascript URL instead such as getURL("javascriptlink code here)");. Which doesn't help my situation of needing to edit and re-publish over 100 SWF games for our sites. Did I mention I'm really hating Microsoft this month... Ok, must not rant. Cheers all.

Dracusis
Maniac (V) Inmate

From: Brisbane, Australia
Insane since: Apr 2001

posted posted 10-19-2006 00:05

. double post

(Edited by Dracusis on 10-19-2006 00:06)



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


« BackwardsOnwards »

Show Forum Drop Down Menu