DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Passing variables from ASP.NET to Flash

  1. #1
    Join Date
    Mar 2006

    Passing variables from ASP.NET to Flash

    I could not find a similar thread to what I've problems with and I'm new to ASP.NET and Flash and I am building an application that requires database and flash. I need to pass variables from aspx to flash. I looked it up and tried the loadvar method. i.e.

    In ClientMenu.aspx:


    Dim strFlash As String = ""
    strFlash = "cname=" & Server.UrlEncode("strClientName") & "&" & "ccardid=" & Server.UrlEncode("ClientCardID") & "&" & "ccpnts=" & Server.UrlEncode("ClientCurrentPoints")

    In fla:
    loadVariables("ClientMenu.aspx", this);
    onClipEvent (data) {

    flashClientName = cname;
    flashClientCardID = ccardid;
    flashClientPoints = ccpnts;

    The flash loads. The variables load into the flash swf. BUT the variables with its values also appear above the flash image as a single string. i.e. above the flash image, this string appears:


    What am I missing?

    Thanks in advance

  2. #2
    Join Date
    Mar 2006
    Here's a solution which is by no means professional, but it helped.

    What I did was just to make it invisible using font color=white in addition to strFlash. The image is however still one line lower than where it should have been if the string wasn't there.

    i.e. response.write("<font color=#FFFFFF>" & strFlash & "</font>")

    If anyone has a better solution (calling all tech gurus out there), I'd prefer that. Thanks.

  3. #3
    Join Date
    Mar 2006

    Try using this

    Check this example which is given in flash LoadVariable Function Help -

    before this create "params.txt" file and save this in it in the same folder of .fla file :



    this.createEmptyMovieClip("target_mc", this.getNextHighestDepth());
    loadVariables("params.txt", target_mc);
    function checkParamsLoaded() {
    if (target_mc.done == undefined) {
    trace("not yet.");
    } else {
    trace("finished loading. killing interval.");
    for (i in target_mc) {
    trace(i+": "+target_mc[i]);
    var param_interval:Number = setInterval(checkParamsLoaded, 100);

    you will get an idea!

    setInterval is threading concept! just look at how it is done if u are not getting threading part!

    (actually in hurry, thats why couldnt answer in detailed...)

Similar Threads

  1. Flash to ASP.NET
    By emad in forum ASP.NET
    Replies: 1
    Last Post: 10-25-2005, 07:31 AM
  2. ASP.NET vs. Flash vs. Java
    By Michael Gautier in forum .NET
    Replies: 3
    Last Post: 09-10-2002, 12:23 PM
  3. Free ASP.NET Web Matrix Design/Editor Tool Released
    By ASPSmith Training in forum dotnet.announcements
    Replies: 0
    Last Post: 06-18-2002, 03:39 AM
  4. Flash mx
    By sam in forum Web
    Replies: 0
    Last Post: 03-15-2002, 01:01 AM
  5. passing Session variables in Form
    By Bill Heffner in forum ASP.NET
    Replies: 0
    Last Post: 11-13-2001, 06:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center