?
Solved

error - A script in this movie is causing Adobe flash player 9 to run slowly etc.

Posted on 2007-03-21
10
Medium Priority
?
7,390 Views
Last Modified: 2008-06-16
I have set up a slideshow gallery script which gets a variable from flashvars from a php page,
and brings it into flash. does some action script and then loops through photos etc.
This works find most of the time, but when i looked at it on my wife's computer I got this error.

Ascript in this movie is causing Adobe Flash Player 9 to run slowly. If it continues to run,
your computer may become unresponsive. Do you wish to abort the script?

what sorts of things should I be looking for to prevent this from happening?
I am not sure of a percentage of people that would recieve this problem, but obviously its not really acceptable for the resulting web design.

any ideas on how to tackle this one?

thanks
Paul
0
Comment
Question by:paulp75
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 11

Expert Comment

by:Tom Ray
ID: 18768543
it would be helpful to see the code.
0
 
LVL 23

Assisted Solution

by:Zeffer
Zeffer earned 800 total points
ID: 18768703
any code that creates a loop..while, for, do while, (there's more)..used in conjunction with operator ++ or continue..can send the player into a spin
..but those problems usually show up in test mode..the main thing that can cause the player to slow just playing a swf that has passed muster on the authoring machine is too many onClipEvent events. If there are quite a few the player can start to struggle on slower machines.

Z
0
 
LVL 3

Expert Comment

by:otroligafredde
ID: 18769725
The reason for the alert window popping up is that a single script, (something that happens in one frame)  is taking more than 15 seconds to run. It pops up so that the user wont close the app down thinking that it has crashed. If you could divide up the work, it would solve the problem. Its hard to say anything specific without having seen the code. But try to look at how you load the images.

Cheers

/Fredrik
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Author Comment

by:paulp75
ID: 18775162
thanks for the responses. Sorry i havent had the chance to get back on here, been a very busy day.
here is the code in the fla file actionscript. i'm really happy with how much i've learned about actionscript in this project. so hopefully i can get this working properly on all computers. works great on 2 i've tested it on , and not worked on 2 others. a bit frustrating really. thanks

import mx.transitions.*
/* first create a new instance of the LoadVars object */
var nextX = 0;
/****************create objects**************/
var initThumb:Object = new Object();
myVars = new LoadVars();

// once vars have been loaded, we will populate the gallery:

      myVars.onLoad = function(){
            mcLargePhoto.loadMovie("http://path.to/photos/"+(myVars['photo'+1]));
      for (var i:Number = 1;i <= (myVars.totalphotos) ; i ++){
      initThumb.photo = "http://path.to/photos/"+(myVars['photo'+i]);
makeAThumb(i);
nextX +=140;
            }
      setInterval(_root,"scroller", 50);
      }
initThumb.onRollOver = function(){
thumbFade = new Tween(this, "_alpha", none, 50,100,.5,true);
}
      initThumb.onRollOut = function(){
      thumbFade.yoyo();
      }
      initThumb.onRelease = function(){
            mcLargePhoto.loadMovie(this.photo);
      }
      function makeAThumb(num){
thumbName = myVars['photo'+num];
mcScroller.attachMovie("thumb",thumbName,num,initThumb);
mcScroller[thumbName].mcPhoto.loadMovie("http://path.to/photos/thumbs/"+(myVars['photo'+num]));
mcScroller[thumbName]._x = nextX;
mcScroller[thumbName]._y = 0;
mcScroller[thumbName]._alpha = 50;
}
function scroller(){
      if (this._ymouse>mcScroller._y) {
      var scrollSpeed = (this._xmouse - Stage.width/2)/20;
      if (Match.abs(scrollSpeed) < 1) {
            scrollSpeed =0; }
      mcScroller._x -= scrollSpeed;
      if (mcScroller._x > 0) {
            mcScroller._x = 0;
} else if (mcScroller._x < Stage.width - mcScroller._width){
                                          mcScroller._x = Stage.width - mcScroller._width;
                                          }
}
}
// call the load method to load my php page
myVars.load("http://path.to/getphotos.php?photo_photoset="+_root.photoset);
this.createEmptyMovieClip("mcScroller",this.getNextHighestDepth());
mcScroller._x = 0;
mcScroller._y = 400;


0
 
LVL 3

Accepted Solution

by:
otroligafredde earned 1200 total points
ID: 18778101
How many images are we talking about. I think that this for loop:
      for (var i:Number = 1;i <= (myVars.totalphotos) ; i ++){
            initThumb.photo = "http://path.to/photos/"+(myVars['photo'+i]);
      makeAThumb(i);
      nextX +=140;
       }
is the bad guy.

in the makeAThumb function you are attaching the movieclip and then load the image again. Both are processes that take a lot of time. Do you have to load the images this way? Do you have to load them at runtime?

Cheers

/Fredrik
0
 
LVL 3

Expert Comment

by:otroligafredde
ID: 18779300
Sorry, I didnt finish my comment. I meant to say that you could try with fewer images or images that are not so heavy to load. And then try that at the computers were you get errors now.

/Fredrik
0
 
LVL 6

Author Comment

by:paulp75
ID: 18783561
thanks i'm on the right track now. I think i need to change the function so it just used the big pic as a variable instead that it loads on release rather than when i first load the movie.

i will let you know if i can work this one out.
thanks
0
 
LVL 6

Author Comment

by:paulp75
ID: 18784364
wierd. i managed to get the error to stop by moving things around. but now it isnt showing anything at all on some computers. once again works fine on others though.
the most photos that are being used at any one time at the moment is 9. its not a massive amount or anything really.
0
 
LVL 6

Author Comment

by:paulp75
ID: 18784810
finally got it sorted. the problem was that i had the full url to the variables file. so it was http://www.thissite.com/getphotos.php instead of just getphotos.php
once i changed it it did the trick
thanks for all the help though.
much appreciated
0
 

Expert Comment

by:rod21
ID: 21794503
I'm just wondering if anyone can shed light on WHY having the full url to the php file would cause this problem? I'm having a similar problem and am just curious...
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question