-
text question: proove your guruness if u can
Is there a way to give text boxes hit detection functionality w/o using buttons?
Flash does this to a certin extent when u place -A- tags around some html text. It automaticly allows that peice of text to detect on click events. (even if it is a single word in a paragraph) Is there some way to replicated this functionality in a normal textbox so that you can execute callBack functions onClick? Or, alternativly, is there some way for Flash to detect when a user clicks a flash-HTML link and execute a flash function?
http://sites.slicker.com/charlestonr...te/cssnav.html
the sub nav (visible after XML loads) is a single dynamic text box with HTML -a- tags to provide link functionality. I also need to detect what link they hit and set another text box to the associated title, however. If flash is in a framed window, how would I know what link the user clicked on so i can set the text?
-
Senior Member
The asfunction makes it possible to execute internal actions with html links in textfields.
Make a search for asfunction, theres a lot of threads on this forum about it. I have no expertice myself on the subject though.
-
thanks man, ill look into it.
-
I pump text boxes full of HTML-encoded asfunction calls on a daily basis:
PHP Code:
for (i=0; i<=yourArray.length; i++) {
textBox_txt += "<a href=\"asfunction:fbx_switch," + link + "\">" + linkText + "</a><br>";
}
And I like it!
hth,
Mike
-
FK'n_dog
it is possible to give text boxes hit detection functionality w/o using buttons, try this -
TextField.prototype.hitTest = hitTest;
_root.createTextField("field1",1,100,100,100,20);
field1.selectable = false;
field1.border = true;
field1.borderColor = 0xFF0000;
field1.text = " field1 ";
_root.createTextField("field2",2,300,100,100,20);
field2.selectable = false;
field2.border = true;
field2.borderColor = 0xFF0000;
_root.onMouseMove = function(){
if(field1.hitTest(_level0._xmouse, _level0._ymouse)){
field2.text ="field1 hit";
field2.borderColor = 0x0000FF;
field1.borderColor = 0x00FF00;
}else{
field2.text ="";
field1.borderColor = field2.borderColor = 0xFF0000;
}
};
_root.onMouseDown = function(){
if(field1.hitTest(_level0._xmouse, _level0._ymouse)){
field2.text ="ouch";
field2.borderColor = 0xFF00FF;
field1.borderColor = 0x00FF00;
}
};
-
yes indeed. Now that I know this, my dynamic flashing will be changed forever. This is some seriously great info, they should print it on the front of the box ..... sweet
-
thanks for code, but I never know how big my text is and I want to just spit it into a slingle box and get flash interactivity. Being able to call functions from A tags is the best damn thing ive ever heard of!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|