A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Help loading external data as a number array

  1. #1
    Flash Explorer
    Join Date
    Sep 2005
    Posts
    52

    Help loading external data as a number array

    So this is driving me a little nutty...

    I'm trying to create an interface that is customizable by changing the data in an external text file, rather than having to open up AS and code away. My main issue comes from the fact that I can't get the data from the external file to be accessible from the main timeline.

    Code:
    PortfolioLoadVars = new LoadVars();
    PortfolioLoadVars.load("portfolio.txt");
    PortfolioLoadVars.onLoad = function() {
    	PortfolioTxt.html = true;
    	PortfolioTxt.multiline = true;
    	PortfolioTxt.wordWrap = true;
    	PortfolioTxt.autoSize = "left";
    	PortfolioTxt.htmlText = PortfolioLoadVars.Empty;
    	port_preview_x = PortfolioLoadVars.xloc;
    	};
    Now, in the text file "porfolio.txt", there are the following values:
    &Empty =
    &xloc=-130,8,-130,8,-130,8,-130,8

    If I try to trace port_preview_x, I get undefined. However, if I remove the code from this loadvars command and attach it to a button, it loads up just fine. I din't particularly want to attach code to buttons (that's just sloppy programming), so what do i do to make my .fla able to read this information from the main timeline?

    I am using MX 04, if that makes any difference.

    Thanks in advance for any help offered!
    Pacem!
    --T
    "Clearly I cannot choose the cup in front of you!"

  2. #2
    Flash Explorer
    Join Date
    Sep 2005
    Posts
    52
    So the other thing that i wasn't sure how to do is how to make an imported string, like the numbers that I'm using in the string &xloc, into a set of numbers to push into an array. I'd hoped to tackle teh first before asking the second, but I guess I'll post this in the hopes that I get at least my second questions answered.

    Thanks for any help offered!
    designerTrevor
    Pacem!
    --T
    "Clearly I cannot choose the cup in front of you!"

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