Solved

Flash clickTAG undefined

Posted on 2007-04-09
4
2,728 Views
Last Modified: 2009-07-29
I am building a flash banner and the site that is going to run it has some instructions that says that I should use getURL(clickTAG1,"_blank") for the links. So I have created a layer at the bottom of my flash file and converted into a movieclip. I have then written:

on (release) {
      getURL(clickTAG1,"_blank");
}
in the action script for the movie clip. I also have a clickTAG2 that gets active after half of the movie. The html looks like this:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>dibanner_live_sv</title>
</head>
<body bgcolor="#ffffff">
<!--url's used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="140" height="175" id="dibanner_live_sv" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="dibanner_live_sv.swf?clickTAG1=http://www.iflexfx.com&clickTAG2=http://www.interactivesignals.se" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="dibanner_live_sv.swf?clickTAG1=http://www.iflexfx.com&clickTAG2=http://www.interactivesignals.se" quality="high" bgcolor="#ffffff" width="140" height="175" name="dibanner_live_sv" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</body>
</html>

When I click on the banner I get the text /undefined at the end which tells me that the clickTAG variables does not get populated. If I write an URL instead of the clickTAG variable in the flash code it works fine but it seems as if I can not pass the variables from the html to the flash. Can anyone see what I am doing wrong?
0
Comment
Question by:Steverino541
  • 2
4 Comments
 
LVL 34

Expert Comment

by:Aneesh Chopra
ID: 18875702
actually you are placing button inside movieClip, but variables clickTAG1 and clickTAG2 are on _root.

to fix this issue..

use following :
---------
on (release) {
      getURL(_root.clickTAG1,"_blank");
}
---------

and

---------
on (release) {
      getURL(_root.clickTAG2,"_blank");
}
---------

- Aneesh Chopra


0
 

Author Comment

by:Steverino541
ID: 18875892
I have written it this way now:
on (release) {
      getURL(_root.clickTAG1,"_blank");
}

Now though a new window does not open. When I click on the banner nothings happens.
0
 
LVL 34

Expert Comment

by:Aneesh Chopra
ID: 18877111
try this:

on (release) {
      getURL(_level0.clickTAG1,"_blank");
}
0
 
LVL 4

Accepted Solution

by:
Blixtsystems earned 500 total points
ID: 18882234
You should be using FlashVars in the embed code instead of adding it as an URL string:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>dibanner_live_sv</title>
</head>
<body bgcolor="#ffffff">
<!--url's used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="140" height="175" id="dibanner_live_sv" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="dibanner_live_sv.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="FlashVars" value="clickTAG1%3Dhttp%3A%2F%2Fwww.iflexfx.com%26clickTAG2%3Dhttp%3A%2F%2Fwww.interactivesignals.se" />
<embed src="dibanner_live_sv.swf" quality="high" bgcolor="#ffffff" width="140" height="175"
FlashVars="clickTAG1%3Dhttp%3A%2F%2Fwww.iflexfx.com%26clickTAG2%3Dhttp%3A%2F%2Fwww.interactivesignals.se"
name="dibanner_live_sv" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</body>
</html>
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now