Flash Advisor logo
:: Desktop Shortcut
:: Flash Help
Advice from Experts

Closed Thread
Results 1 to 3 of 3

Thread: ASP --> Flash

  1. #1

    Default ASP --> Flash

    hello everyone,

    Im haveing trouble passing a session variable from my asp to flash. What happens is i have a website that when you log in to it the database pulls the persons member number. With that it is stored into the <% =Session["MemberNumber"] %>

    we use that membernumber to direct the user to the proper pages (secure or not secire pages) with a query that looks something like this:

    http://www.domain.com/SwitchNonSec.aspx?mn=<% =Session["MemberNumber"] %>&path=Whatshot.aspx

    Hopefully i made that clear lol. So far this is what i have:

    HTML Code:
    <script type="text/javascript">
                    
    AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','200','height','192','src','menu.swf','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','menu' ); //end AC code
                    
    </script>
    <noscript>
                    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="200" height="192">
                      <param name="movie" value="menu.swf?mn=<%= Session['MemberNumber'] %>" />
                      <param name="quality" value="high" />               
                      <embed src="menu.swf?mn=<%= Session['MemberNumber'] %>" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="200" height="192"></embed>
                    </object></noscript>
    and for th AS 3.0 i have:

    Code:
    var myQueryStrings = this.loaderInfo.parameters;
    
    var userURL:String = "http://www.greatescapesonline.com/SwitchNonSec.aspx?mn=";
    var MemberNumber:String = myQueryStrings.mn;
    var userEndURL:String = "&path=Whatshot.aspx";
    
    var userCompleteURL:String = userURL + MemberNumber + userEndURL;
    
    
    function URLPASSED(TraceVar:String) {
        navigateToURL(new URLRequest(TraceVar));
    }
    
    testbutton_mc.addEventListener(MouseEvent.CLICK, testLink);
    
    function testLink(e:MouseEvent):void{
        navigateToURL(new URLRequest(userCompleteURL));
    }
    The problem is that the link coming up says that the value of the MemberNumber is null. this is what comes up:

    http://www.domain.com/SwitchNonSec.a...=Whatshot.aspx

    Can someone please help?

  2. # ADS
    Join Date
    Always
    Posts
    Many
     
  3. #2

    Default

    Ok so i figured out one problem which is now im getting the MemberNumber to pull in to my <object> and <embed> tag. I add to the allowScriptAccess param.

    But now i need help importing the number into my flash in order to imput the number into the URL's. This is my new HTML:

    HTML Code:
    <script type="text/javascript">
    AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','200','height','192','src','menu','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','menu' ); //end AC code
    </script>
    <noscript>
    <object 
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" 
    width="200" 
    height="192">
      <param name="movie" value="menu.swf" />
      <param name="quality" value="high" />
      <param name="FlashVars" value="mn=<%=Session["MemberNumber"]%>">
      <param name="allowScriptAccess" value="sameDomain" />
      <embed src="menu.swf" 
      quality="high" 
      pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" 
      type="application/x-shockwave-flash"
      FlashVars="mn=<%=Session["MemberNumber"]%>" 
      allowScriptAccess="sameDomain"
      width="200" 
      height="192">
       </embed>
    </object>
    </noscript>
    and my AS 3.0

    Code:
    var userURL:String = "https://www.domain.com/SwitchSec.aspx?mn=";
    var MemberNumber:Number = this.loaderInfo.parameters.mn;
    var userEndURL:String = "&path=Whatshot.aspx";
    
    var userCompleteURL:String = userURL + MemberNumber + userEndURL;
    
    testbutton_mc.addEventListener(MouseEvent.CLICK, testLink);
    
    function testLink(e:MouseEvent):void{
        navigateToURL(new URLRequest(userCompleteURL));
    }
    do any of you see whats wrong? it is saying that the variable mn=NaN?

  4. #3

    Talking Hi23

    I need to learn English, which is very important because it’ll help me get a good job in international trade, which I'm studying right
    Last edited by Vlykarye; 01-09-2010 at 04:10 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Sponsors
Create Speaking Characters for your website and Flash movies. 15 Day Free Trial