Groups | Blog | Home
all groups > flash actionscript > march 2004 >

flash actionscript : Talking TextAreas


MacGyver_97
3/8/2004 5:33:40 PM
Hi;

I'm looking for a way to have two or more TextAreas talk to each other. I'd
like to have each area load an external XML file. If there is a link in one,
I'd like to change the contents of a second TextArea on the same screen. In
essence, have 2 or more IFRAMES that can all refer to each other (complete with
scroll bars and so forth).

Can anyone direct me to tutorials or suggest how this is done?

Thanks,
Neal.
CesareRocchi
3/8/2004 7:13:50 PM
To insert links in textfields they have to html textfields. Then, by means of
asfunction,
you can call whatever function you want.

<a href="asfunction:my_function,my_param">click here</a>

HTH,

-c.
MacGyver_97
3/9/2004 12:35:55 AM
Thanks, Cesare. I appreciate the help, however the main problem I'm having
isn't how to call a function within a TextArea, but rather how to tell a second
TextArea (by name) to load an XML file from a link contained in the first
TextArea (which itself has XML data in it).

Hope this makes sense.... Any ideas or links to something?

Thanks,
Neal.
CesareRocchi
3/9/2004 11:27:05 AM
_global.function = loadXML (fileName, textArea) {
// code to load xml of 'fileName' in textArea
}

// code in textArea1
<a href="asfunction:loadXML,test.xml,yourTextArea2">We are in textArea1 and we
want to load test.xml in textArea2</a>

HTH,

-c.


MacGyver_97
3/9/2004 3:19:29 PM
Thanks a lot for the followup. This looks like what I want to do. I'll try it out and see if it works.

Thanks again,
Neal.
MacGyver_97
3/9/2004 7:18:14 PM
Me again :)

This doesn't quite work since I'd need to have the link to appear in the
external XML file itself, not in the Flash document. For example, in
"one.html", which is loaded into TextArea "myText1", there is a link to load
file "two.html" in "myText2".

A good example of this is on the website:
http://www.pgiinteractive.com/flash_content.html. See the Case Studies
section. Each time you click on a topic, the TextArea boxes change their
contents.

I really appreciate the help. I'm stuck on this last bit, and then I can
launch my website!

Thanks,
Neal.


AddThis Social Bookmark Button