A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Remoting coding and other thingies

  1. #1
    Senior Member vevmesteren's Avatar
    Join Date
    Sep 2001
    Location
    Montréal, Québec
    Posts
    566

    Remoting coding and other thingies

    better code
    hello world. Seems like a good one to start out this string. I need some help on best practices. See I am currently working on my first FlashRemoting Application. It is going better then I had dared to think when starting but here's my problem. When running the thing on a...say slower machine (350Mhz, 128mb RAM so not SLOW-slow) things start gettin funky. Now, every movieclip I have created is no bigger then 20k so we're not talking any crazy file-sizes. Bu still, it is rather silly what now hapens. All the listboxes, all the dropdowns are just so ridiculasly slow that I think I will have to revert to HTML, well at least a mixture out of the two (CFMX and FlashMX). But no Flash main interface cause it is just not customizabvle enough from the exteriour. At least not as far as I can see.

    So after all this text, here is what I need. Do you have any ideas/guidelines on how I can make the application work more smoothly,seemlessly. I am currently reading up the material from macromedia.com/desdev

    what I would greatly apreciate are experiences, ideas when it comes to online flash application development. Or rich internet applications as MM likes to call it. Are they really as crossplatform, narrow/broad band friendly as Macromedia would like them to be

    V
    it is your mind that decides - it is with your mind that you fly


    vevmedia

  2. #2
    Junior Member
    Join Date
    Aug 2000
    Posts
    9
    Ok you say you have your Movie Clips down to a 20k in size but that's not the half of the story. How many do you have on stage at a time and what are they doing. Example:

    Movieclip #1 Has 2 Frames and has a script simmilar to this:

    onClipEvent(enterFrame){
    if(_global.userAccess == "Value"){

    }else if(_global.userAccess == "anotherValue"){
    do something here;
    }else if(_global.userAccess == "anotherValue"){
    do something here;
    }else if(_global.userAccess == "anotherValue"){
    do something here;
    }else if(_global.userAccess == "anotherValue"){
    do something here;
    }else if(_global.userAccess == "anotherValue"){
    do something here;
    }else if(_global.userAccess == "anotherValue"){
    do something here;
    }else if(_global.userAccess == "anotherValue"){
    do something here;
    }else if(_global.userAccess == "anotherValue"){
    do something here;
    }else if(_global.userAccess == "anotherValue"){
    do something here;
    }else if(_global.userAccess == "anotherValue"){
    do something here;
    }else if(_global.userAccess == "anotherValue"){
    do something here;
    }
    }

    This code causes a huge load on the processore because Flash will iterate over every if condition in the bloack and then carryout the one that matched. A better way to do it is to use the switch/case method because Flash stops processing the block as soon as it finds a match. Now you might say that's no big deal but it is if you have say 3 or 4 of the MovieClips on stage at a time doing the same type of if-else processing. On a fast machine like a P3 or P4 this isn't noticable but the minute you step down to a 350Mhz 233Mhz it becomes and freaked out machine. Add to that what ever else you have going on on the stage be it sound and images all that adds to the processor usage and the slower/ older a machine is the more freaked out it gets. Not to mention if you have you Flash Swf's Frame Rate set really high (20fps or better) this will really freak out a processor because now if you take into account the same scenerio as about with the if-else statements, you are asking the processor to iterate through 11 if-else statements and make a decision twenty times a second. (20fps and the enterFrame means each frame the if-else gets processed) Now add to that the overhead of 3-4 MovieClips doing the same thing now you are asking the processor to handle upwards of 44 if-else statement 20 times a second and well it's a no wonder your machine doesn't start smoking. (Just kidding)

    Hope this helps you out.

    Bsmuv

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