Search code examples
asp.netflash-cs3

Get Variable value from asp.net page in CS3.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


Solution

  • 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>