PDA

View Full Version : links within dynamically loaded text



samba_7
January 17th, 2004, 06:08 PM
Dear All.

I have a dynamic text box (myText.text and services.text), that load different texts from different buttons. Below is the code for one of the buttons. Where it says... "here" I want to create a link that opens up a centred html file. Is there any coding that I can use?

wed1_btn.onRelease=function() {

myText.text = "Wedding Consultation... ? ";
services.text = "Our consultation.. blah blah. Click here for fees ";

}

Thank you for reading.
Sam.
:rd:

McGuffin
January 17th, 2004, 06:19 PM
myText.html = enabled;

Then have your link in HTML code:

<a href="http://www.mysite.com">Wedding Consoltation...?"</a> or whatever the HTML code for that is ;)

Hope that helps some, Colin :cap:

samba_7
January 17th, 2004, 08:39 PM
Gentle Programmers of the Flash World.

I looked at what Colin had written and went deeper into my 'definitive guide to FlashMX' book. I just wanted to share my results.

On a dynamic text box, with multiline, where the instance is myText:

To add HTML productivity to the text field we do as follows:

myText.html = true;
myText.htmlText = '<font face="arial" size="10">Here is a good example of using HTML within actionscript</font>

Note the use of " " and ' '. In Actionscript we can assign values using single or double quotations: e.g
myText.text = "Samba Web Design" OR
myText.text = 'Samba Web Design'

When using HTML we assign: font face="arial", which would confuse actionscript if we didn't use the single quotation. Because our assignments would end at the first quotation in the "arial".

Hope this helps. I guess the key is to 'read more'.
=)