View Full Version : flashVars + HTML Wrapper + Flex 2

11-27-2006, 03:58 PM

Can someone please help me….

I am trying to use “flashVars” within my Flex 2 application…..

I am having trouble incorporating them into the wrapper (HTML file) that is created by default when the flex application is built….

When I try to include the flashVars in the param and embed script:

<param name="FlashVars" value="…………." />
<embed src="…." quality="high" flashvars="………." name="……." play="true" etc………………..

depending on the context, I get different javaScript conflicts and errors…

is there a standard format to follow when creating a wrapper for flashVars using Flex 2???

Can anyone help me, or post an example etc….?

Thanks, Jon.

Matt Voerman
11-28-2006, 06:25 AM
Could you clarify what the issue is? Are you having problems only embedding the FlashVar values within the generated HTML or getting the values to correctly pass?

Does this help?

<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='500' height='500'>
<param name='flashVars' value='firstname=Nick&middlename=D&lastname=Danger'>
<param name='src' value='FlashVarsValues.mxml.swf'>
<embed pluginspage='http://www.macromedia.com/go/getflashplayer' width='500' height='500' flashVars='firstname=Nick&middlename=D&lastname=Danger' src='FlashVarsValues.mxml.swf'/>

11-28-2006, 06:36 PM
Ok Jonny I honestly don't know anything about this but I would note a few points.

First off is this or is this not directly related to your post passing variables using the URL (http://www.actionscript.org/forums/showthread.php3?t=121773&highlight=flashvars)?

Secondly let's take a step back and look at what you want to do. From my reading of your posts you have an application that you are trying to develop. It needs multiple ways of entry and action. The HTML is not so much a "shell" around the Flex/Flash application as it is required to interact with it at times. Am I correct in this understanding? We could all discuss the validity of that way of defining a User Interface for days, but regardless of that fact, these are the requirements, the specifications that have been given to you. Again am I correct in that?

Now an important point is the fact that you were given JavaScript errors. You were not given errors from the Flash or Flex module. It was JavaScript that complained. The actual error(s) would be good to know, or at least some idea of. I mean they could be any of numerous types of errors, perhaps quite valid and just dependent on the circumstance. But errors are given for a reason. They provide information to the "user" So the errors are important and what types of errors are also important.

It really sounds like you're having problems with the two parts talking to each other. And that's quite understandable, heck at times I have problems just getting one side of my brain to talk and in a productive way, to the other side. (that was supposed to be a joke)

If you have two "sides" communicating with each other then you have both of them needing to a) listen b) remember and c) utilize.

It sounds like you have A figured out or working to a degree. Where you're seeing the problem is really in C in the utilization of the concept. And the reason I phrased it in that way is that I think you're missing something and not in the Flex/Flash side of things but in the JS side of things.

I could quite be wrong, but I would bet that a bit more information as far as what the Javascript errors are might give us more information as to the cause, and it's eventual solution.