A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [RESOLVED] Dynamicly Load Variables then Dynamicly loop threw them? Help plz :(

  1. #1
    Junior Member
    Join Date
    Jul 2003
    Posts
    9

    [RESOLVED] Dynamicly Load Variables then Dynamicly loop threw them? Help plz :(

    Hello and thanks for looking, here is my propblem i am currently loading a list of images with this code.
    Code:
    var myLoadVars = new LoadVars();
    myLoadVars.load("http://www.DomainName.com/SlideShow/GetImages.cfm?AlbumID=12");
    myLoadVars.onLoad = function(success)
    	{
    		gotoAndPlay("start");
    		
    	};//Close Successful
    
    	
    
    	var i = 1;
    The variables being sent are as such myLoadVars.img1 .. all the way to myloadVars.img266.

    at the "start" frame i have a simple action script that resets the i to 1 then continues to the next frame and ill show ya why in a secound.

    The next frame called "fade" has this code.
    Code:
    var imgString:String = "img"; // 
    
    var temp:String = imgString + i
    
    Test.text=myLoadVars.temp;
    
    // for testing purposes Test is a dynamic text field
    now here is the problem

    When i do Test.text=myLoadVars.img1 it works great the text box displays the image name. but when i try to do something like

    Test.text=myLoadVars.variable it says undefined.

    The variable as ya can see is the concadination of 2 variables one with "img" and the other with "i". i at this point is 1. which should theoredicaly give ya
    when i send "Temp" which is the concadination of thoes two variables the output is "img1" but when i place it all together in

    myLoadVars.Temp it doesnt work.. Does any one know how to access the variables dynamicly?

    so eventually i could simply loop the i and cycle threw all the img names..



    Thanks for looking

    ~Peter M.

  2. #2
    Junior Member
    Join Date
    Jul 2003
    Posts
    9
    I got it working i saved all the values to an array and i cycle threw the array , thanks for looking but i got it working

    ~PEter

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