PDA

View Full Version : SetVariable Problem


rhythmofrain
03-28-2005, 07:54 AM
I am using a Flash object on asp page and the asp page is reloaded with different variables on clicking on a link. The variables then sent in flash,

The problem is that on some PCs it works but on others it does not set the variables on reloaidng the page.
what can be the possible reason.
i am using this code to call the flash object

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"

codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="customProdReady"

width="580" height="300" align="middle">

<param name="movie" value="../flash/customProdReady.swf?id=2050&img=<%=imgFile%>&Side=<%=picSide%>" />

<embed src="../flash/customProdReady.swf?id=2050&img=<%=imgFile%>&Side=<%=picSide%>" quality="high" bgcolor="#000000"

width="580" height="300" swLiveConnect=true id="customProdReady" name="customProdReady" align="middle"

allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"

/></object>


then <%=sTextForFlash%> comes as the result of sql query

and after this the variable is sent to flash

window.document.customProdReady.SetVariable("TextData", "<%=sTextForFlash%>");

simonboris
03-29-2005, 02:00 AM
Well, if i understand what you are trying to do is to set a varable value with the flash object in html using javascript...

This will only work on internet explorer and since 'swLiveConnect' is no longer supported in Mozilla based browser such as netscape, firefox, safari... It will only work on ie...

With Flash, you can write javascript in your html page at runtime and execute function you have just written to your document... But you cannot return value in flash except in ie...

But if you find a way... share...

pyrocorp
03-29-2005, 04:48 AM
this may be a bulky and unpractical workaround...

it would be possible to send the vars to a database then retrieve the from flash once the movie is open

simonboris
03-29-2005, 09:52 PM
yes, use sever side code and send&load method (xml or loadvars)... this would be better...

And since it is text, you should consider xml since you can easily structure the data you are sending to flash and database...

rhythmofrain
03-30-2005, 01:31 AM
The problem is resolved by sending a random variable:
<param name="movie" value="../flash/customProdReady.swf?id=2050&img=<%=imgFile%>&Side=<%=picSide%>&r=<%=r%>" />

<%=r%> is random number generated every time the asp page reloads