Knowledge Base |
* Flash - general use problems
(views: 11072)
These issues are not necessarily related to our components and they represent general issues of using Flash.
Use clickTag with AS3 clip
(2008-09-18 - views: 27250)
Q: How should the clickTag be applied on a ActionScript 3.0 clip ?
A: You need to specify the URL of the page to the Flash clip embedded into the HTML, through FlashVars. The name of the parameter is usually clickTag. The FlashVars parameters are placed in a list of parameters on the root object.
In your Flash clip, all you have to do is create a button that will open the desired page when clicked and assign the actions that will open the page. The button can be a simple transparent clip that covers the entire surface of your Flash movie. If the button instance name is "buttonClip" and the FlashVars parameter name is "clickTag", then the code to apply the clickTag functionality is this one:
var paramList:Object = this.root.loaderInfo.parameters;
buttonClip.addEventListener(MouseEvent.CLICK, openURL);
function openURL(evtObj:MouseEvent):void {
var request:URLRequest = new URLRequest(paramList["clickTag"]);
navigateToURL(request, "_blank");
}
Files: Clicktag with AS3.zip
In your Flash clip, all you have to do is create a button that will open the desired page when clicked and assign the actions that will open the page. The button can be a simple transparent clip that covers the entire surface of your Flash movie. If the button instance name is "buttonClip" and the FlashVars parameter name is "clickTag", then the code to apply the clickTag functionality is this one:
var paramList:Object = this.root.loaderInfo.parameters;
buttonClip.addEventListener(MouseEvent.CLICK, openURL);
function openURL(evtObj:MouseEvent):void {
var request:URLRequest = new URLRequest(paramList["clickTag"]);
navigateToURL(request, "_blank");
}
Files: Clicktag with AS3.zip
User Comments
write to support
http://www.jumpeyecomponents.com/support/open.php
posted by florodebat on 2009-06-01
please open a new ticket support and write there a detailed description of what you are trying to achieve and shortly you will get an answer. Click the link below in order to open a new support ticket. http://www.jumpeyecomponents.com/support/open.php
click tag problem
Followed you instructions above and pasted this code onto a layer on it's own
// The clickTag variable is placed through FlashVars in a list of parameters
// that the current clip uses when loading. Those paremeters can be accessed
// fropm the LoaderInfo object of the current clip. The name of the variable
// doesn't necessarily have to be "clickTag". You can name it anyway you like.
var paramList:Object = this.root.loaderInfo.parameters;
// Listen for the CLICK event on the button clip.
buttonClip.addEventListener(MouseEvent.CLICK, openURL);
// When the button is clicked then the navigateToURL function will open the
// specified URL. The function does not accept the URL directly as a String.
// You need to specify the URL as a URLRequest object.
function openURL(evtObj:MouseEvent):void {
var request:URLRequest = new URLRequest(paramList["clickTag"]);
navigateToURL(request, "_blank");
}
This seems to break the stop action in the banner. It has a 30 frame time-line. I'm not much of a coder and need simple clear instruction on how to make this work.
Thank you.
posted by damono on 2010-04-12
Hi guys,Followed you instructions above and pasted this code onto a layer on it's own
// The clickTag variable is placed through FlashVars in a list of parameters
// that the current clip uses when loading. Those paremeters can be accessed
// fropm the LoaderInfo object of the current clip. The name of the variable
// doesn't necessarily have to be "clickTag". You can name it anyway you like.
var paramList:Object = this.root.loaderInfo.parameters;
// Listen for the CLICK event on the button clip.
buttonClip.addEventListener(MouseEvent.CLICK, openURL);
// When the button is clicked then the navigateToURL function will open the
// specified URL. The function does not accept the URL directly as a String.
// You need to specify the URL as a URLRequest object.
function openURL(evtObj:MouseEvent):void {
var request:URLRequest = new URLRequest(paramList["clickTag"]);
navigateToURL(request, "_blank");
}
This seems to break the stop action in the banner. It has a 30 frame time-line. I'm not much of a coder and need simple clear instruction on how to make this work.
Thank you.
click tag problem
The animation could also stop working if the code is not correct. Please make sure you added the transparent movieClip over the stage and called it "buttonClip" as it is specified in the code.
posted by florodebat on 2010-04-13
damono, The animation could also stop working if the code is not correct. Please make sure you added the transparent movieClip over the stage and called it "buttonClip" as it is specified in the code.
Where do i put my link?
I was wondering where do i put my link in the code?...
i really dont get it :(
posted by Philliplind on 2010-12-13
Hey,I was wondering where do i put my link in the code?...
i really dont get it :(
RE:Where do i put my link?
You just need to add the flashVars parameter to your object & Embed tag and you are ready to go.
posted by kneo on 2010-12-13
That's obvious, you put the link in the html code.You just need to add the flashVars parameter to your object & Embed tag and you are ready to go.
So...
posted by Philliplind on 2010-12-13
I just copy the code and safe the swf and in my banner system i write the code?..
RE:So...
Also you have an example which can be downloaded.
posted by kneo on 2010-12-14
You need to do exactly what I told in my previous comments and what says in this post.Also you have an example which can be downloaded.
Hmm
// The clickTag variable is placed through FlashVars in a list of parameters
// that the current clip uses when loading. Those paremeters can be accessed
// fropm the LoaderInfo object of the current clip. The name of the variable
// doesn't necessarily have to be "clickTag". You can name it anyway you like.
var paramList:Object = this.root.loaderInfo.parameters;
// Listen for the CLICK event on the button clip.
clicker_mc.addEventListener(MouseEvent.CLICK, openURL);
// When the button is clicked then the navigateToURL function will open the
// specified URL. The function does not accept the URL directly as a String.
// You need to specify the URL as a URLRequest object.
function openURL(evtObj:MouseEvent):void {
var request:URLRequest = new URLRequest(paramList["clickTAG"]);
navigateToURL(request, "_blank");
var clicker_mc:URLRequest = new URLRequest("http://www.test.com");
}
posted by gamemaster on 2011-01-11
I cant get it to work, please see my code below (what did i do wrong)?!// The clickTag variable is placed through FlashVars in a list of parameters
// that the current clip uses when loading. Those paremeters can be accessed
// fropm the LoaderInfo object of the current clip. The name of the variable
// doesn't necessarily have to be "clickTag". You can name it anyway you like.
var paramList:Object = this.root.loaderInfo.parameters;
// Listen for the CLICK event on the button clip.
clicker_mc.addEventListener(MouseEvent.CLICK, openURL);
// When the button is clicked then the navigateToURL function will open the
// specified URL. The function does not accept the URL directly as a String.
// You need to specify the URL as a URLRequest object.
function openURL(evtObj:MouseEvent):void {
var request:URLRequest = new URLRequest(paramList["clickTAG"]);
navigateToURL(request, "_blank");
var clicker_mc:URLRequest = new URLRequest("http://www.test.com");
}
RE:Hmm
var clicker_mc:URLRequest = new URLRequest("http://www.test.com");
And in the html did you add the flashVar param (clickTAG)?
posted by kneo on 2011-01-11
What's this for?var clicker_mc:URLRequest = new URLRequest("http://www.test.com");
And in the html did you add the flashVar param (clickTAG)?
Login to post your comment










I'm on a deadline and cannot add the clicktag code for the button on my banner.
Please help