Is there any way to tell the processor speed of the machine that a Flash movie is running on? I have a processor intensive Flash file (to be run off a CD ROM) and I want to give the user the ability to select between this version and a less intense version. I would like to give them a hint as to which one to select in case they have no idea is their machine is fast enough. Using MX2004. Thanks for any help.
there's no direct way to determine cpu speed. however, you can run a cpu intensive flash loop and see when the processor starts to slow. that will let you judge a user's cpu capacity. taking some code from another thread today you can use the code below. it draws lines on the screen. my 64-bit amd 3400 starts to slow between the 500th and 600th line: _root.createEmptyMovieClip("mc1", 1); with (mc1) { this.diffA = new Array(); this.cnt = -1; this.ccnt = -1; this.test = 0; lineStyle(1, 0xFF0000, 100); moveTo(0, 0); onEnterFrame = function () { this.cnt++; if (this.test) { // every hundred iterations a test is run to see if the time required to add a new line has slowed from the start of this process this.test = 0; this.diffA[this.ccnt] = getTimer()-this.startTime; trace(this.diffA[this.ccnt]); if (this.diffA[this.ccnt]>this.diffA[0]+10) { delete this.onEnterFrame; trace("done "+this.ccnt); // this is where you can determine which version of your movie to play. } } lineTo(500*Math.random(), 500*Math.random()); if (this.cnt == Math.round(this.cnt/100)*100) { this.ccnt++; this.startTime = getTimer(); this.test = 1; } }; }
Wow, this is a very good idea!
thanks I will give this a try. [quoted text, click to view] "MyFlashMXIN" <webforumsuser@macromedia.com> wrote in message news:c9ii1h$m90$1@forums.macromedia.com... > Wow, this is a very good idea! > Thanks for sharring kglad!
Don't see what you're looking for? Try a search.
|