0

I have a flash application (CS3.0) that is published and i got the flash HTML and put it inside asp.net page. The asp.net page include a public variable which is set in the loading of the page i need to get this variaable value in the code of the flash to do some operations based upon this variable so how can i get this variable value in the CS3.0 aplpication which resides in the page.

Hope that my question is clear if any illustrations needed just determine it and i will explain it more.

Thanks in advance

Ahmy
  • 5,420
  • 8
  • 39
  • 50

1 Answers1

1

You could do something like the following code below on your aspx page, note inparticular the following line: 'FlashVars', 'PublicProperty=<% Response.Write( PublicProperty ) %>'

<script language="javascript">
    if (AC_FL_RunContent == 0) {
        alert("This page requires AC_RunActiveContent.js.");
    } else {
        AC_FL_RunContent(
        'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
        'width', '100%',
        'height', '100%',
        'src', 'Game',
        'quality', 'high',
        'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
        'align', 'middle',
        'play', 'true',
        'loop', 'true',
        'scale', 'showall',
        'wmode', 'window',
        'devicefont', 'false',
        'id', 'Game',
        'bgcolor', '#ffffff',
        'name', 'Game',
        'menu', 'true',
        'allowFullScreen', 'false',
        'allowScriptAccess', 'sameDomain',
        'movie', 'Game',
        'FlashVars', 'CID=<% Response.Write( PublicProperty ) %>',
        'salign', ''


        ); //end AC code
    }
</script>
Kevin
  • 85
  • 5
  • And how can i call this variable from action script code? did the variable name is "CID"? so i will get its value by this line of code : var VarValue:String = CID.toString();?? – Ahmy Aug 17 '09 at 07:51
  • The variable can be named anything, it is just a copy and paste, from a working example. To access the variable in flash you can use: root.loaderInfo.parameters.CID – Kevin Aug 17 '09 at 08:11
  • This is not working do u have another solution? and i need to tell u that i am not including this code i am including tags which is in case of noscript and i don't use this code int he page so can u help me again please? i have add to u +1 for ur attention thanks – Ahmy Aug 18 '09 at 13:04