dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: General Scripting Question

  1. #1
    Wannabe PHP Wizard
    Join Date
    Nov 2001
    Location
    Leechburg, PA
    Posts
    129

    General Scripting Question

    I've got a movie clip that is going to be pulling data from the Internet. It's a welcome message. There will be two variables. switch and welcome. The switch will display the welcome message if it's a, and the normal screen if it's b. That's easy.

    Now the question. If I wanted to run the script, in an infinite loop, so that it checked the Internet for new data, say, every minute, would flash eventually have trouble? It will be running in a normal movie window. I just wanted to make sure it wouldn't freeze up if it played for days at a time.

    If the movie was running 30fps, then I would make a clip of 1800 frames that would reload the variables and make adjustments.

    Thanks ahead for the insight.
    Clint
    Clinton N Godlesky
    My Stuff:
    http://www.15656.com/clint http://www.statedirt.com
    Personal Development Projects:
    http://www.15656.com/dev

  2. #2
    AS3 Mod
    Join Date
    Sep 2007
    Location
    O-H-I-O
    Posts
    2,385
    Just use the setInterval function in flash to call your function that checks the variable. Will be no issues.

    For the love of god do not create 1800 frames and let that loop.

  3. #3
    Wannabe PHP Wizard
    Join Date
    Nov 2001
    Location
    Leechburg, PA
    Posts
    129
    So, something like this?

    Code:
    var intervalId:Number;
    var duration:Number = 10000;
    
    function getMyData(){
    	loadVariables ("http://www.400lb.com/development/clint/datasource1.php", 0);
    }
    getMyData();
    intercalId = setInterval(this, "getMyData", duration);
    I'm using Flash 8.

    Also, initially, it doesn't seem to be working.
    Clinton N Godlesky
    My Stuff:
    http://www.15656.com/clint http://www.statedirt.com
    Personal Development Projects:
    http://www.15656.com/dev

  4. #4
    Wannabe PHP Wizard
    Join Date
    Nov 2001
    Location
    Leechburg, PA
    Posts
    129
    Nevermind, jumped the gun. It works fine.
    Clinton N Godlesky
    My Stuff:
    http://www.15656.com/clint http://www.statedirt.com
    Personal Development Projects:
    http://www.15656.com/dev

  5. #5

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