A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Preloader for PHP data

  1. #1
    Senior Member
    Join Date
    Apr 2001

    Preloader for PHP data

    Ok here it goes:

    I am sending a Var to a PHP and then getting the result back using the myVar.sendAndLoad(); So... What I am trying to do is create a preloader for the MC that is going to display the data. Here is what I have:

    function sendData (btn) {
            sendVars = new LoadVars();
    	// sendVars.id = btn; is the name of the button that will be needed by the PHP script.
            sendVars.id = btn;
    // I have tried these  
    // percentLoaded = this.getBytesloaded() / this.getBytesTotal();
    // percentLoaded = sendVars.getBytesloaded () / sendVars.getBytesTotal
    // But these have failed to output the actual percent loading. 
            sendVars.onLoad = function(success){
    		_root.mainWindowMC1.team.text = this.team;
    	        _root.mainWindowMC1.mode.text = this.mode;
    	        _root.mainWindowMC1.gamedate.text = this.gamedate;
    		_root.mainWindowMC1.time.text = this.time;
    		_root.mainWindowMC1.np.text = this.np;
    		// There are alot more just making the post smaller.
                trace("error loading data...");
    	_root.mainWindowMC1._x = 250;
    	_root.mainWindowMC1._y = 250;
    Now this all works, But I don't know where to place the preloader, I have tried several ways without any luck. So I can preload a SWF into an MC with a preloader in that MC , I have tried several ways to do that but I just can't do it for the PHP vars cause I use the loadVars Obj instead of the way I did with SWF wich was loadMovieNum.
    Please help

  2. #2
    Senior Member
    Join Date
    Apr 2001

    Rephrasing this

    Ok maybe I shoudl ask, Is it just the same as creating a preloader for a img/swf. What I i'm loading is Var from a PHP file. Is there a differnce.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

HTML5 Development Center