ActionScript 3.0 :: SetInterval Function Runs Very Slow In IE8
Sep 9, 2010I am doing some animation using setInterval. It runs ok on all browser(firefox, sarfari, and opera..), but not in IE8. I just check ie7, it works fine also.
View 4 RepliesI am doing some animation using setInterval. It runs ok on all browser(firefox, sarfari, and opera..), but not in IE8. I just check ie7, it works fine also.
View 4 Repliesrecently i am working on my portfolio which I am doing in flash cs4, as3. It runs fine on local machine but when i upload it into the server, it runs very slow. in face there is a section where pictures are loaded when a thumbnail is clicked. There are 15 pictures and it doesnot opens at all.
following is the link to the site that I have done so far[URL].. please click on the "projects" to look at the problem I am mentioning. the section"3d modeling is the part where there are 15 pictures and doesnot load at all. same problem with "3d animation" "video editing" works fine. it may be because it has just one video to load.
You can download it here [URL]external swf's when loaded.....run very very slow; sometimes unresponsive as if there is a script running in the background. I'm using keyboard commands to navigate through the screens - eg:on (keyPress "<Space>") {gotoAndStop("scene02", "firstframeLabel");}
View 3 RepliesI have made a plattformgame in flash, and after I had published it I tested it (local) when it was embedded in a browser, and it hacks and laggs! But when I play it in the flash player it works just fine.
I removed all the heavy graphics, lowerd the fps to 30fps and removed all the code so now its just the bassis left (gravity, collision, key checking etc. and yes u should bounce on the walls giving a wall jump effect).[URL]
I have problems with flash games and some advanced flash applications.Problems occurs regardless of browser.My computer is next:CPU: 2.8GHz hyper threadRAM: 1.5 GB (3 pieces)GPU: Nvidia 7600 GS Gigabyte.When it runs some flash game e.g. Facebook Pet Society, CPU load goes high as 80 to 100 %. It is very annoying thing since I am starting to loose my mind how to solve this.All other applications are running very good. This means games, 720p HD videos etc etc.
View 1 RepliesWhen I preview my SWF from within Flash or run the exported swf outside of Flash, it has suddenly become extremely slow, maybe 10 FPS or something. But then it runs smoothly if I
- run it in a browser embedded in a HTML page
- run a preloader locally which simply loads the problematic SWF file; once the problematic SWF file shows up, it runs perfectly.
This doesn't make sense to me, and it's really annoying to be unable to just Shift+Enter to preview. Anyone tried anything like this before?
I have created a flash application that runs crisp and smooth normally. However, when I set it to fullscreen using
Code:
fscommand("fullscreen", "true");
Then it runs slow as heck. My cpu usage shoots up to the 90%'s on all four cores. Strange thing is, however, that if I manually resize the projector chrome to take up the full screen size it runs smooth and crisp. It's not playing any videos or sounds, and there are minimal images. The swf file itself is 7 megs, and that's almost entirely because I have to embed the chinese alphabet. Could it be from running dual monitors? It still only "fullscreens" to one monitor's size, so I don't think its's twice the size without me noticing... I'm really not sure what's causing it, but it gets super slow...
The swf and fla files are located at: [URLs]
.fla is only 448kB, but the swf is 7megs.
Again, it runs fine when not in fullscreen, no matter how large I make the window, but if you play the swf file in flash player (i.e. not in browser) it will run slow until you press esc and exit fullscreen mode.
I have a fairly complex animation movie clip within my main timeline in a Flash file. When you click a button, it plays the movie clip, then goes back out to the main timeline. The first time the movie clip runs, it plays choppy and slow, but if I play it two or more times, it plays correctly (smoothly). Is there some actionscript I need to preload the movie clip, or some other solution to the first-run slowness?
View 2 RepliesI'm feeling a bit low now as I have been suffering this for months. A simple loader loads my simple game and runs VERY FAST on even slow pcs BUT when I build this other loader, it goes quite slowly and I don't know where the app is going wrong. WHERE is the processing consumptoin coming from out of my app.
[Code]...
I could be mistaken of course.... here is the code.
[AS]
picNames = ["pic1.jpg", "pic2.jpg", "pic3.jpg", "pic4.jpg", "pic5.jpg", "pic6.jpg"];
picNamesB = ["pic7.jpg", "pic8.jpg", "pic9.jpg", "pic10.jpg", "pic11.jpg", "pic12.jpg"];
[code]......
I have one function that runs when a certain button is pressed. However, I want this function to also run when enter is pressed. I know that I can make a function to do this alone, but is there any way that I can make the function that I already have made (that is set to run when the button is pressed) to run also when enter is pressed?
View 3 RepliesI want to run it when the user mouses over a hidden button.
Code:
var container:MovieClip = new MovieClip();
addChild(container);
root.transform.perspectiveProjection.fieldOfView = 120;
[Code]....
You can see I have a MC called "btn" but the code only runs once when the btn MC is moused over. I'd like to call the addstar function continously while the btn is being moused over...
I have 4 buttons with instance names: 'alfa', 'bravo', 'charlie' and 'delta'. I want to make a function that runs on mouse click on either of the buttons. I tried this, but could remember exactly how it should look:
[Code]...
I have a function that I want to run at an interval within a frame. I use the following code to start the function:
var intervalID = setInterval(intervalFunction, 3000);
Then, in a button's onRelease I want to stop the function. In the onRelease, I make a transition to another frame.
btn.onRelease = function()
{
clearInterval(intervalID);
gotoAndPlay("nextframe");
}
The intervalFunction continues to execute.
I'm creating a banner ad that tweens a thought bubble.It has 3 bubbles which tweens from the small bubble(1st one) to the big(3rd)one every 1/2 second with the setInterval function and then Invokes another setInterval which changes the text in the big bubble every 2sec. I got it to work perfectly, but the only problem is that I cant get it to loop through again properly. When I try to invoke the setInterval "animBubble" in the changeText function it doesnt read the clearInterval in the "animBubble" function causing it not to stop once the 3rd bubble has tweened in.
Here is my code:
ActionScript Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
[code]...
[AS]
_root.logo._alpha = 0; //S�tt alpha p� logon till 0
_root.meny._alpha = 0; //S�tt alpha p� menyn till 0
var donealpha:Boolean = false; //skapa en Boolean[code]......
The first two functions wont get executed.. I have tried to put trace("test") strait under the function ...(){ but it wont execute it..
I added a setinterval function to my slideshow.Prob is when the slideshow reaches the last pic it returns to pic1 goes to pic2,... but after the second loop it starts mixing the wrong pics for the wrong number.I guess I did a mistake in the if statement(if (nextSlideNode == null)...). can someone solve this for me.
See following code below. Also how can I stop this animation. I did something like learinterval(advance); but that did not do the trick.
[Code]...
Code:
_root.leftButton.onRelease = function() {
for(var i=0; i<6; i++){
animateThumbsToLeft(variable_1, variable2);
}
};
ok how and where do i put the setInterval script if i want to execute the "animateThumbsToLeft" function for 6 times and inbetween each time have a delay of say half a second..
how to clear the interval in this code? I'd also like to know if there is a better way of firing makeStars() than using setInterval in a function - like I'm doing. I've looked at the Kirupa tutorial and I'm not seeing what should be done.
Basically, this attaches a number of stars within the Stage width and height properties. When the browser resizes I rewrite the stars to the screen with the new bounds. But I can't get the interval to stop, so the stars just keep getting replaced - disappearing and relocating abruptly.
It all works great outside of the resizeIt() function, but once inside she goes down hill from there. A couple of things I need cleared up (pun intended) are:
1. Am I creating a new interval each time resizeIt() is executed?
2.What is the scope of the interval(s), and does how you access them change depending on where you are in the code, or are they more global?
stop();
//number of stars to make
var numstars:Number = 100;
_root.attachMovie("background","bkgd",this.getNext HighestDepth());
[Code].....
If i have a setInterval inside a function, will it execute at the desired interval, even if i only call the containing function once?
View 5 RepliesI have a function on my script that attaches a movieclip on a specific position and then it duplicates it several times. This movieclip has a code in order to move across the stage randomly. When I try to use SetInterval to repeat this function two weird things happen: the movieclips don't duplicate over that specific location (they appear on x=0,y=0) and if I set the location only one duplicates and the rest don't. My question is: what can I do to repeat the function every 2 seconds exactly as it is the first time it runs, without the objects not duplicating or moving from the original location?
Here's the code:
meteoros = function () {
this.attachMovie("asteroid","asteroid_mc",this.get NextHighestDepth());
[code].....
Why is this not working? It just passes through the function instead of pausing. Source is attached:
View 10 RepliesI got this MC I load. How could I put a setInterval function in front of it?
Code:
onClipEvent (load) {
this._x = 100;
[Code]....
And what if I wanted to do this with several MC's in the same movie?
[AS]
_root.logo._alpha = 0; //Stt alpha p logon till 0
_root.meny._alpha = 0; //Stt alpha p menyn till 0
var donealpha:Boolean = false; //skapa en Boolean
var doneshrink:Boolean = false; //skapa en Boolean
var donemove:Boolean = false; //skapa en Boolean
[Code] .....
The first two functions wont get executed.. I have tried to put trace("test") strait under the function ...(){ but it wont execute it..
I have four buttons on the stage which I want to move 20 pixels up (easing) and fade in from 0 to 100. But I want them to appear with a interval of 1 second. I came up with the following function:
Code:
function showClips(yPos, alpha, speed) {
var endY = yPos - this._y;
this._y += eindY /speed;
[Code]...
I have a function that draws a rectangle on the screen (see createInfoPanel())While drawing rectangle, I am adding 2 text fields on it.But as you may guess, it is adding those immediately. I want to delay adding these text fields, then I want to remove these panels after a while. The problem is, when I set an interval or timer, they won't work after I using once (I had to stop them by clearing/removing, it didn't set them again).Since my panel is being created each time image changes, I need them to work every time image changes.
So, I have 2 questions:1- How can I re-set interval each time my createInfoPanel() function works? It won't work anymore after setting and claring once. 2- You can see infoPanel.addChild(titleField); line in addInfoPanel() function. How can I work a smooth animation here? I mean, text appears slowly?
[Code]....
I have a custom class called SpeedCheck, in this class I have a function called Activate(), I am trying to call this function using setInterval from another class but I am not sure how to format it.
This is how I would normally call the function:
ActionScript Code:
SpeedCheck.Activate()
I tried this:
ActionScript Code:
setInterval(SpeedCheck ,"Activate",100);
but it doesn't work, what am I doing wrong?
My issue is that I want to set up a system whereby I can register clips to a class that will have certain properties set and then animate changes in those properties. Namely, each clip is placed at a different _y position at authoring time, then at run time be repositioned at a different _y position, only to be animated back to the original position. I want to do this so I can edit the clips in their destined places to layout their positioning.
Visually, my code works fine but, as is apparent from the "trace("muvUp "+thing);", the interval isn't being cleared. And what's worse � at around 40000 (of getTimer()), the clips start disappearing.
I've attached a file but here's the code I'm working with (as you can see with the lines I've commented out, i've tried a few different options):
//MY CLASS ON FRAME 1:
function wordsClass(){}
wordsClass.prototype = new MovieClip();
wordsClass.prototype.onLoad = function(){
[Code]....
I am creating a text scroller and am having problems with clearInterval - the text starts scrolling, but it won't stop after I try to clear it upon a button click.
1. I declare a var (uint) equal to a setInterval() call within a function (if the text exceeds the width of the textField)
2. I have a button that "turns off" the mp3 player (swf) and resets all the text fields.
3. I can't seem to access the setInterval ID var from within the click handler.
I have declared the var (uint) at the root level, then set it to setInterval() within the function. Then I tried to access it from the click handler. I thought this would work since it's global at that point, but it doesn't.
Here's a link to the page so you can see how it doesn't work [URL] (you have to click on the last link with the long client name)
Here's the code that's involved with this function (of course this is only the relevant code, but I would post the fla when done for anyone who wants to use it):
Code: Select all//::: SCROLL DISPLAY TEXT
function scrollDisplays():void
{
(trackTextField.textWidth > trackTextField.width) ?
[Code].....
OK, trying to fade out a button through a function. I've done this before but I'm tired and it's just not happening. OK, there's a button named "button" and a movieclip named "fadeThis". The first frame of the root has the following code in it:
[Code]...