Welcome, Guest
  • Author Topic: LoadVars upper version than v6 player ?  (Read 3075 times)

    0078h

    • Guest
    LoadVars upper version than v6 player ?
    « on: 12/22/05, 13:27 »
    Hi,

    Could you help me with please, i 'd like to publish it with flash 7 or 8, what's wrong with this code :

    catalog = new LoadVars()

    // Load the vars from the external Php file
    catalog.load("http://localhost/data/site/select.php")
    catalog.onLoad = function(success) {
       object1 = catalog.getBytesTotal()
       for(this.a=1;this.a<=catalog.total;this.a++){

    // Create an array (ObjectN) for each object in the catalog
          catalog["object"+this.a] = catalog["Oggetto"+(this.a)].split("|")

    //Add into the combobox the names of the objects in the catalog
    comboname.addItem(catalog["object"+this.a][0])
    delete(this["Oggetto"+this.a])
     }
    }


    thank's

    papachan

    • Systems Administrator
    • *****
    • Posts: 507
      • View Profile
      • Air Flex Developer
    Re: LoadVars upper version than v6 player ?
    « Reply #1 on: 12/22/05, 13:43 »
    dont have test it here but take the load method to the last line of your script.... maybe flash ide lost the onLoad handler.

    var catalog:LoadVars = new LoadVars();
    catalog.onLoad = function(success) {
    if (success) {
       object1 = this.getBytesTotal();
       for (this.a=1; this.a<=this.total; this.a++) {
          this["object"+this.a] = this["Oggetto"+(this.a)].split("|");
          comboname.addItem(this["object"+this.a][0]);
       }
    }
    };
    catalog.load("http://localhost/data/site/select.php");

    0078h

    • Guest
    Re: LoadVars upper version than v6 player ?
    « Reply #2 on: 12/22/05, 13:59 »
    thank's for the reply but it crash too, i use a button with the combobox :

    on(press){
       selected = _root.comboname.getSelectedIndex()
       loadMovie(_root.catalog["object"+selected][5]+".jpg","object_image")
       _root.name.text = _root.catalog["object"+selected][0]
       _root.description.text = _root.catalog["object"+selected][3]
    }

    i don't understand why it crash

    0078h

    • Guest
    Re: LoadVars upper version than v6 player ?
    « Reply #3 on: 12/22/05, 14:01 »
    i forget to say that it works with the flash 6 player

    papachan

    • Systems Administrator
    • *****
    • Posts: 507
      • View Profile
      • Air Flex Developer
    Re: LoadVars upper version than v6 player ?
    « Reply #4 on: 12/22/05, 14:17 »
    "crash"? you mean it close the IDE? can you trace the total variable inside the for?

    0078h

    • Guest
    Re: LoadVars upper version than v6 player ?
    « Reply #5 on: 12/22/05, 15:12 »
    i have a warning box and have to close it, but you're right total is undefined, should i use another method ?

    papachan

    • Systems Administrator
    • *****
    • Posts: 507
      • View Profile
      • Air Flex Developer
    Re: LoadVars upper version than v6 player ?
    « Reply #6 on: 12/22/05, 15:26 »
    if it's undeifned probably a character ampersand break the request string... but strange if it work in flash6...
    execute a simple

    for(var i in this)
    trace(i + " "+ this)

    you will see there if the total variable appear...

    0078h

    • Guest
    Re: LoadVars upper version than v6 player ?
    « Reply #7 on: 12/22/05, 15:54 »
    thank's ! it works !
    you've saved my life  8)

    0078h

    • Guest
    Re: LoadVars upper version than v6 player ?
    « Reply #8 on: 12/22/05, 16:07 »
    it was the uppercase of Total, not total (excuse my english)
    i had never see the utility of trace before