Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AC_FL_RunContent - need to pass different values on a variable

Status
Not open for further replies.

fedtrain

Instructor
Jun 23, 2004
142
US
I am working on a project to pass a variable from a link on a page that already exists, to a swf file. The old way of doing this will not work for this project, I must avoid the blackbox/click to activate issue. Also, I have multiple links that will each send a different value to the variable, so it cannot be hardcoded (i'll show this later.)

Goals: 1) Open swf in new page without the 'click to activate' issue 2) Pass the appropriate value in the varible to use to control the movie.

This is the old code, and give the black box issue. But, it does pass the variable well enough at the moment.
Code:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
   codebase="[URL unfurl="true"]http://download.macromedia.com/pub/shockwave[/URL]
   /cabs/flash/swflash.cab#version=7,0,19,0" width="400" height="250" id = "varMovie" title="varMovie">
<param name=movie value="passVar.swf?vars='+vars+'" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="quality" value="high" />
<embed src="passVar.swf?vars='+vars+'" quality="high" pluginspage="[URL unfurl="true"]http://www.macromedia.com/go/getflashplayer"[/URL] type="application/x-shockwave-flash" width="400" height="250" name = "varMovie">
</embed>
</object>

This is the new code that is being used by Adobe to address the issue...
Code:
<script type='text/javascript'>");
"AC_FL_RunConten('codebase','[URL unfurl="true"]http://download.macromedia.[/URL]
    com/pub/shockwave/cabs/flash/swflash.cab#
    version=7,0,19,0',
'width','400',
'height','250',
'title','passVar',
'src','passVar.swf?vars="+vars+"',
'quality','high',
'pluginspage','[URL unfurl="true"]http://www.macromedia.com/go/getflashplayer',[/URL]
'swLiveConnect','true',
'movie','passVar');
//end AC code 
</script>

In the code above I am attempting to replicate what I am doing in the old code, by passing the variable 'vars'. I need the value of 'vars' passed to the movie, but nothing is happening.

Additionally, it turns out I need the .js for this to run. Now I currently have that living in the same folder as the index page...so I am figuring I call it like so...
Code:
<script src='AC_RunActiveContent.js' type='text/javascript'>
</script>

Has anyone figure out this new stuff yet and is there a way to do what I need to do?

"Credit belongs to the man who is actually in the arena - T.Roosevelt
 
Well, you could probably use Flashvars (in the same manner I showed you how to get the query string to work...) but in conjunction with the swfObject (for the EOLAS problem) as described under...
Passing variables into your movies using the "Flashvars" parameter...

...On this page...




Regards. Web Hosting - Web Design
03/13/05 -> OLDNEWBIE VS FLASHKIT
 
Hi, I'm trying to do exactly the same thing on my webpage, and feel like i'm banging my head against the wall.... i'm getting nowhere.

Did you get anywhere in the end?

Cheers,
JonnyT.
 
Yeah, i had a look at that before and had alot of problems.

I am now thinking of adopting the advice here:


titled:
"External JavaScript solution 1: For single (or few) occurrences of embedded content"

This may work, as i do only have one occurrence - it just changes parameter.

Cheers,
JonnyT.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top