Home Category Blog How to add a clicktag Action Script 3

How to add a clicktag Action Script 3

E-mail Print PDF
Please note that the following instructions are for ActionScript 3.0 only. Please refer to ActionScript 2 post if you are working with ActionScript  2. To find out what verion you are working with use this tool.
  1. Under File -> publish settings and the under flash tab.  Make sure your file is set to Flash Player 8 under Flash Version.
  2. Create a new layer (Insert > Timeline > Layer)
  •  
    • Order it above all other layers,
    • Double click the new layer and name it accordingly such "click or clickTag"
    • Select the first keyframe in that layer.
  1. Using the Rectangle tool, draw a rectangle encompassing the entire area of the ad.
  •  
    • You can define the size within the properties panel below.

 


 

  1. Convert the rectangle to a button. Using the Selection tool  from the toolbar.  If you can't see it Ctrl F2,
  •  
    • Right click and select Convert to Symbol
    • Type a name such as  "ClickTag" for the name
    • Select Button as the Type and Click ok
  1. Double-click the button we just created 300x250
  •  
    • go into symbol editing mode to edit it, and drag the Up keyframe to the Hit keyframe.
Before  After
  1. Go back to the main timeline by clicking Scene 1.
  2. Select the Keyframe of the ClickTag layer we created earlier
  •  
    • Open the Actions panel (If the Actions panel is not open choose Windows > Actions or you can press (F9).
  1. Copy and paste the following code into the ActionScript field. Please Note: You may need to manually retype the " quotes as copy and paste copies a different type of character that flash doesn't recognise which will cause issues. 

Link_1.addEventListener( MouseEvent.MOUSE_UP, function(event: MouseEvent): void { var sURL1: String; if ((sURL1 = root.loaderInfo.parameters.clickTag)) { void ExternalInterface.call('open', sURL1, '_blank'); } } );

  1. Once you have added the click tag we need to reference the button we made earlier to call that actionscript code.
  •  
    • Click on the 300x250 button we created.
    • You should see in the properties panel a blank text area, this is where we add the reference (Called Instance Name).
    • Copy and Paste Link_1 into the text field. If you cant see the properties panel go to Window > Properties or click CTRL + F3.
  1. Upload into DFP using flash.
  2. Once you have uploaded the swf and backup gif's. You need to change some code within the text area. From this var dcallowscriptaccess = 'never';To this var dcallowscriptaccess = 'always';See example screen shots below.
  1. Save your flash file Save As, or Save. To export the swf file you can press CTL + Enter and it will automatically create the swf file in the same location you have saved your flash file.
Please note DFP does not fully support ActionScript 3 and you still may experience pop up blocker issues.
Good Luck
Last Updated ( Tuesday, 23 August 2011 11:24 )  

Add comment


Security code
Refresh

Name:

Email:

Sample image

Latest News

Popular