HZGN.COM
welcome to my space
X
Search:  
Feng Shui | Graphic Design | Cosmetics | Causes and Organizations | Regulatory Compliance | Gadgets and Gizmos | Computer Forensics | Tools and Equipment | Related articles
Welcome to:hzgn.com
NAVIGATION - HOME

referencing variables with LoadVars();

Published by: webmaster 2009-01-07

  • Ok, here's the dilemma that i hope someone might be able to help me with. I am creating a contact form that will collect user data that is to be passed to a .php script that will then create and store the info in an .xml formatted file for accessing later.

    I was trying to use the loadVariables function to pass the information to my .php script, but I kept receiving an error message in the output window saying that there was an error accessing the URL of my .php script (absolute URL used, not relative). So I decided to try the LoadVars method to send my data to my .php script, however I'm a bit confused about something.

    I have created 5 input boxes in my .fla for storing my data and I have given them the variable names (variable name, not instance name) of:

    firstName
    lastName
    phoneNumber
    emailAddr
    schoolName

    I then enclosed all of my input boxes into a movieclip which I gave the instance name of form. Since I have given my input boxes variable names, I am confused as to how I should refer to them in the LoadVars ActionScript. Should I refer to each of them by the variable name that I have assigned to each box?


    var myVars = new LoadVars();
    form.myVars.firstName = firstName;
    form.myVars.lastName = lastName;
    form.myVars.phoneNumber = phoneNumber;
    form.myVars.emailAddr = emailAddr;
    form.myVars.schoolName = schoolName;


    Or is there another way that I'm supposed to reference my variables inside the form movieclip when using LoadVars?


    var myVars = new LoadVars();
    form.myVars.firstName
    form.myVars.lastName
    form.myVars.phoneNumber
    form.myVars.emailAddr
    Flashvalley - Flash tutorials - LoadVars::
    Oct 8, 2007 Learning to use the LoadVars class to load variables in Flash. (ActionScript 2.0 Language Reference) If you use onData and onLoad in the
    http://www.flashvalley.com/fv_tutorials/LoadVars/page2.php?show_comments=true
    HOME
    detect if local file::
    loadVariablesNum("something.php",0,"GET");. is a pretty specific reference to a PHP file in the same directory as the Flash movie.
    http://www.webmasterworld.com/forum88/12753.htm
    HOME
    form.myVars.schoolName


  • Thanks guys. The reason that I asked was because I already a nextFrame function call on my submit button to make the .swf jump to a frame showing a loading message (or a progress bar if I could ever get the dern thing to work right...) so that the user isn't just sitting there while the .swf i waiting for the success message to be sent back from my .php script. Basically, it's like this:

    Frame 1: User enters in data and presses submit button.
    >sendAndLoad function shoots data to .php script.
    >nextFrame function jumps the movie one frame.
    Dynamically Referencing Variables::
    Dynamically Referencing Variables. (1/1). willgwitt: I had been using LoadVariables. Based on advice in your your tutorial, I'm trying LoadVars.
    http://www.flash-db.com/Board/index.php?topic=14720.0;wap2
    HOME
    sending variables, the new way. - kadazuro.blog::
    do you remember the time when if you need mimic a form behavior or send variables through the http, you just needed to grab a loadVars ojbect,
    http://www.kadazuro.com/blog/archives/000128.php
    HOME
    Frame 2: Loading message appears.
    >.php script processess data, creates and stores data in .xml file.
    >.php script sends success message to .swf.
    >On receipt of the success message myVars.onLoad/nextFrame function jumps the movie one frame.
    Frame 3: User sees a thank you message for entering data and is allowed to proceed to next phase of the process.

    This is how I would like the .swf to work. Would that be possible?


  • Thanks Defective. I'll give it a shot. I appreciate the help.

    :thumb2:


  • Defective: Let me ask you this. Would it be possible to put

    myVars.onLoad = function(){
    _root.nextFrame();
    }

    inside a frame instead of inside the ActionScript for my submit button?


  • PWNd by Alberta again:upset:


  • Hey all I did was write onPress instead of on(press) :shifty:


  • np.... i think you'll be fine, if in doubt... don't hesitate the pm me.


  • Ok, I'm following you. Then when I call the sendAndLoad(); all I have to do is:


    on(release) {
    form.sendAndLoad("path/to/php/file.com", myVars, "POST");
    onClipEvent(data){
    _root.nextFrame();
    };
    }


    Is that close?


  • The loadvars is not contained within that parent, you dont need the "form" thing:
    var myVars:LoadVars = new LoadVars();
    myVars.firstName = form.firstName;
    myVars.lastName = form.lastName;
    myVars.phoneNumber = form.phoneNumber;
    myVars.emailAddr = form.emailAddr;
    myVars.schoolName = form.schoolName;


  • I could really use some help on this issue. Very much appreciate it!!!


  • Something like this should work on a frame:
    var myVars:LoadVars = new LoadVars();
    myVars.onLoad = function():Void {
    nextFrame();
    };
    myButton.onPress = function():Void {
    myVars.sendAndLoad("path/to/php/file.php", myVars, "POST");
    };
    :pope:


  • Yes, but a little more like this:
    on(release) {
    myVars.sendAndLoad("path/to/php/file.php", myVars, "POST");
    myVars.onLoad = function(){
    _root.nextFrame();
    };
    }
    :D


  • Theres probably a way to do it from where it is, try to keep all AS in an empty layer.





  • Red Hat's Rough Recovery From CFO Exit
    Windows Live Finds a New, Pre-installed Home

    PRINT Add to favorites
    #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about referencing variables with LoadVars(); , Please add it free.
  • 5 steps in the refrigeration cycle of almost any refrigeration unit
  • 5 reasons penn ventilation is popular today
  • 5 great things about the fisher infant price stroller toddler
  • 5 great environments to use stained glass film
  • 5 great reasons to take stained glass courses
  • 5 reasons to purchase wholesale hvac units and parts
  • 5 reasons to purchase clear hurricane shutters
  • 5 facts jeep tandem stroller vs jeep twin stroller
  • 5 options for pink crib bedding for your baby
  • 5 places to buy wholesale baby blankets
  • 4 ways a jeep pink stroller umbrella benefit you
  • 5 types of everyday refrigeration gaskets
  • 5 methods for getting hvac training
  • 5 things t o look for in a commercial hvac maintenance agreement
  • 4 tips when expecting twins what to eat and the twin infant stroller
  • 5 types of heatcraft refrigeration units
  • 5 great ways to spend time with your child hand games to a pink baby stroller
  • 5 products to consider rocawear baby stroller and other items
  • 5 options for portable crib bedding
  • 5 optimal home improvement ideas leaded glass doors and other door options
  • 5 things you may find are available if you purchase air king ventilation products
  • 5 aprica baby stroller models 2003 explored and explained
  • 4 top choices for an allo baby stroller
  • 5 facts about the infant safe stroller toddler voyage created
  • 5 things all latex mattress manufacturers want
  • 4 types of furnace filters
  • 5 great ideas for using a stained glass bevel

  • About us -Site map -Advertisement -Jion us -Contact usExchange linksSponsor us
    Copyright© 2008 hzgn.com All Rights Reserved
    Site made&Support support@hzgn.com    E-mail: web@hzgn.com