Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 10-06-2010, 04:02 AM   #1
Join Date: Mar 2010
Posts: 51
Default Trouble with link events

Im creating text links with as3 for the first time and want to add some extra interactivity, animation etc on button hovers, clicks etc etc.

so far I have text setup as follows (simplified)

import flash.text.StyleSheet;
import flash.events.TextEvent;

var jeffText:TextField = new TextField() 
jeffText.htmlText = "<a href='http://site.com/'>http://site.com/</a>"; //note for link to be ACTIVE it needs to be HTML formatted HERE
jeffText.x=33; jeffText.y=802; 
jeffText.width=150; jeffText.height =21;

var LowerBoxStyleCSS:StyleSheet = new StyleSheet();
LowerBoxStyleCSS.setStyle("a:link", {color:'#32CCFF', textDecoration:'none', fontSize:'13', fontFamily:'verdana'});
LowerBoxStyleCSS.setStyle("a:hover", {color:'#32FFFF', textDecoration:'none'});

jeffText.styleSheet = LowerBoxStyleCSS; 

The above works for my simple links. Via another sites tutorials I am trying to add some simple effects on hovers or buttons clicks but cant get it to work and need some help... The below code is what im trying to use..

jeffText.addEventListener(TextEvent.LINK, linkHandler);

function linkHandler(linkEvent:TextEvent):void {
         //STUCK HERE.. tried manipulating linkEvent.text without success
	//simple eg to test would be, jeffText.x =- 5 on hover
thanks in advance
Khorask is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT. The time now is 10:46 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.