开发者

AS2 textField hyperlink

I have to add something to an existing as2 project. I know as3 pretty well, but as2 doesn't make sense to me at all. Basically what 开发者_运维技巧I have to do is add a link to the bottom of every "page". The link changes depending on what "page" you are on. I have variables passing, so all I need to do is create the link.

//Url gets passed here
var urlString;

createTextField("urls", 1, 300, 499, 150, 30);
urls.setNewTextFormat(my_fmt); 

urls.text = urlString;

Now I have to turn "urls" into a link. What would be the best way to do this?


This would be one possible solution: Create a movieclip to hold the textfield and then use it as a button...

//Url gets passed here
var urlString = "the URL";
this.createEmptyMovieClip("urlHolder", 1);
urlHolder._x = 300;
urlHolder._y = 499;
urlHolder.createTextField("urls", 1, 0, 0, 150, 30);
//urlHolder.urls.setNewTextFormat(my_fmt);

urlHolder.urls.text = urlString;

urlHolder.onRelease = function(){
    getURL("www.google.com");
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜