Solved

Flash clickTAG undefined

Posted on 2007-04-09
4
2,732 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
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…

820 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