-
OnRelease problem! easy one i guess CS4
Hi guys. I really hope that you will be able to help me out on this one! it been a pain in the *** to find a solution.
I got this movieclip. With actionscript i attached a new movieclip to this one, as a popup menu, which will show on rollover. Inside this movieclip, it automatically makes textfields, as menu options (information i recieve from a XML document)
The problem is, that i cannot get it to respond on a onRelease function on those text fields, and i do not know why.
Heres the code for the textfields
Actionscript Code:
marray = explode(",",mn); var sizes = 0; for(var i=0;i<=marray.length - 1;i++){ trace(i); mc.menu1.createTextField("txt"+i, i+59, 0, sizes, 100, 25); mc.menu1["txt"+i].onRelease = function() { getURL("http://pos.dk", "_blank"); }; mc.menu1["txt"+i].text = marray[i];
sizes = Number(sizes) + 25;
}
As you see, i tried to make a onRelease on one of the links, but it just wont work probably, whats the fix for this?
Hope someone will be there for my rescue
Regards
Trekz
-
Textfield.onRelease? that doesn't exist. onRelease works for buttons and/or Movieclips.
gparis
-
Allright thanks. So may i ask what you would suggest me to do?
Regards
Jonas
-
duplicate/create movieclips in each of which you create a texfield. Put the onRelease on those movieclips.
gparis
-
Can you post any kind of example please? Really appreciate your help
-
Just use exactly the same routine, but instead of creating "txt"+i, create "mc"+i. Then inside each mc create one textfield. Then you can say:
mc.menu1["mc"+i].onRelease
and
mc.menu1["mc"+i].txt.text = marray[i];
Here's the doc for createEmptyMovieClip. The example contains exactly what you need (creation of a mc with a textfield inside)
gparis
-
Thank you! I did this, and the part where it makes the mc works just perfect! the problem is there still though, i tried every combination. this.onRollOver=function() { }
container.onRollOver=function() { } and everything else, it just wont register the rollover.
-
Got it to work finally. sorry i cant post the solution, but there was no "golden" solution for this one, i rearranged the whole code.
thanks for the code.
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
|