dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: loading var from text file

  1. #1

    loading var from text file

    Hello,

    I need to load a var (number) from a text file
    in the following way:

    in the text file I write:
    product=1

    the flash reads this txt file and goes to frame
    number 3 (for example) - because product=1.

    if the number written is 2 - so flash goes
    to frame number 4 (for example).

    any help is needed
    Regards,
    Elad Maor

  2. #2
    Senior Member
    Join Date
    Apr 2002
    Posts
    682
    Code:
    onClipEvent (load) {
    
    	loadVariables("filename.txt",_root.myLoadVar);
    
    	function checkParamsLoaded() {
    
    		if (_root.myLoadVar.product== undefined) {
    			trace("not yet.");
    		} else {
                         if (_root.myLoadVar.product ==1) {
                            _root.gotoAndStop(3);
                          }
                         if (_root.myLoadVar.product ==2) {
                            _root.gotoAndStop(4);
                          }
    }
    }
    }

  3. #3

    hello again

    can you send an example
    cause I can't make it to work.

    thanks a lot
    Regards,
    Elad Maor

  4. #4
    Senior Member
    Join Date
    Apr 2002
    Posts
    682
    Sorry, I didn't give you a step by step, but don't forget to make an empty mc called myLoadVar.

    http://www.cowfly.com/misc/loadVar.zip

  5. #5
    Senior Member
    Join Date
    Apr 2002
    Posts
    682
    Did it work?

  6. #6

    Yes it worked

    Thank you so much

    Have a great day
    elad
    Regards,
    Elad Maor

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