E
E
esy2014-08-13 13:54:14
ActionScript
esy, 2014-08-13 13:54:14

How to convert Action Script 2 link to Action Script 3 link?

Good evening!
I am making flash banners. Used and still use the ActionScript 2 reference programming language.
Recently there was a need for an innovation due to which I had to abandon ActionScript 2 in favor of ActionScript 3.
In connection with this, there was a problem:
In ActionScript 2, this reference was used:
on (release) {
if ( _root.p) {
url = " http://a.weblink.com/c/?p= "+_root.p + (_root.b ? "&b="+_root.b : "") + (_root. refid ? "&refid="+_root.refid : "");
} else {
url = " http://www.refid.com/ "+(_root.refid ? "?refid="+_root.refid : "");
}
getURL(url, "_blank");
}
Now I can't use it in ActionScript 3 and it's clear why.
Question: can anyone help me with writing a link for ActionScript 3, that is, converting a link for ActionScript 2 so that it can be inserted into ActionScript 3 and it would not lose its function.
Thank you in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2014-08-13
@CTAKAH4uK

var request:URLRequest = new URLRequest("http://URL");
navigateToURL(request, "_blank");

A
Alexander, 2014-12-22
@lisnic1990

var flashVarsObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
var link:URLRequest = new URLRequest(flashVarsObj.donotchange);
clickBtn.addEventListener(MouseEvent.CLICK, function(){
if (flashVarsObj.donotchange != undefined) {
navigateToURL(link, '_blank');
}else
{trace('link apcent');}
});
I used this code for banners.
flashVarsObj.donotchange is just the variable that stores the link to the site.
accordingly, if other variables are passed to you via flashvars, just substitute
flashVarsObj.X - where X is a variable. flashVarsObj - This is like _root in AS2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question