ActionScript 2.0 :: SetInterval Not Working In Class?
Feb 7, 2008public function showImageAt(num:Number):Void
{
var interval:Number = setInterval(
function():Void {
[Code]......
so the test function never gets called...
public function showImageAt(num:Number):Void
{
var interval:Number = setInterval(
function():Void {
[Code]......
so the test function never gets called...
I was wondering why my current code for calling a setInterval on a function doesn't work inside my class.I have this code inside one function, calling a second function.
intID = setInterval(selfReferential, dupe, 30, 0x000000);
The selfReferential keyword refers to the current class,but was defined previously (selfReferential = this; ).I get no errors, but the dupe() function is never called.and I had the selfReferential variable replaced with the this keyword at one point as well.
I have a flash 9 app that calls a php script that in turn pulls in some variables from txt files. The function within the flash file that calls the php script operates via a setInterval() function. For some reason, this works fine in Firefox and Safari, but in IE the swf fails to update the fugures unless i clear the cache and reload the page..rather than the setInterval() function doing so every 60sec...
View 0 RepliesI can't see why this setInterval isn't working ..basically I want it so a new instance of the same image from the library gets placed on stage at various time intervals at a different alpha level each time ... >
Code:
var myInterval:Number;
var number:Number = 1000;[code]............
I'm having difficulty adding a setInterval to a Flash Movie I'm working on. Every time I try to introduce it all the elements fail to display.Attached is the Zip of where I'm up to so far - I have 9 blocks swinging onto the screen all at once (they finally come to a halt to reveal a picture). I'm trying to get them to appear one at a time with a delay inbetween.
View 7 RepliesI have a flash 9 app that calls a php script that in turn pulls in some variables from txt files. The function within the flash file that calls the php script operates via a setInterval() function. For some reason, this works fine in Firefox and Safari, but in IE the swf fails to update the fugures unless i clear the cache and reload the page..rather than the setInterval() function doing so every 60sec...
View 1 RepliesThe first scene will have an embedded movie clip and artwork as a background for approximately 150 frames, the next scene (Scene 2) then appears (in the first and only frame) which has the following (AS2) setInterval on it (to play a swf file on a movie clip - the swf lasts a little over 2 minutes. Hence, 122000 milliseconds below):
Code:
mc_demos.loadMovie("swf/aquira.swf");
stop();
[code].....
I have a very odd issue with Firefox 3. Take the following code
ExternalInterface.addCallback("startAds", null, startAds);
function startAds() {
debug("Calling startAds");
[Code].....
The startAds function is called from javascript. When run in IE 6 & 7 everything works fine. When run in Firefox 3 i can see it enter the function and even assign and intervalId but the function set in the setInterval function never gets called. If i call setAds from actionscript and run it in Firefox 3 it works ok. Its just when the startAds function is called from javascript in Firefox 3.
I'm trying to create a wipe, where a bar expands vertically from the top to the bottom. This was accomplished with a motion tween. Now, I'm trying to use AS to duplicate that one bar across the screen, and this is done inside a movieclip, and the movieclip is on the main stage and it is setMask(my_mc); to reveal an image beneath.
Here's the code I'm using:
totalBars = Math.round(Stage.width/bars._width);
i = 0;
duplicate = function () {
if (i <= totalBars) {
i += 1;
bars.duplicateMovieClip("bars"+i, this.getNextHighestDepth());
this["bars"+i]._x = i*bars._width;
}else{
clearInterval(intervalID); }};
var intervalID = setInterval(duplicate, 10);
But it doesn't work!
i've tried searching the forums and fighting with this way of fading the movie clip in and out. The movie clip has an instance name of "box", my brother also can't figure it out.
Code:
var fadeChecker:Boolean = true;
function flicker():Void{
if(box._alpha >= 100){[code].....
If I place some working setInterval code within a function and then call the function, it fails:
Code:
function RevealLinks():Void {
menu_mc._visible = true;
[code].....
I have a setinterval thats playing up i am trying to load a external swf into the timeline after .5 seconds it works fine but it just keeps recalling the function, I just cant seem to clear the interval.
This is the AS on the button:
on (release){
trace("working");
_parent.play();
_parent._parent.fadeOut(7);
_parent._parent._parent.urdMain_mc.play();
[Code] .....
I am working on someones as2 file and I noticed that they had an onEnterFrame running non stop in the movie. I don't use onEnterFrame personally. So I tried to create a conditional to stop it. While the conditional worked its stopped the fluid animation they had used. So I need to figure out some other way to get rid of the onEnterFrame. Anyone have any ideas here? The AS basically resizes a box on stage when certain movies are loaded.[code]
View 5 RepliesI did this cheesy banner for my portfolio and i dont understand why the setInterval is not working correctly. The thing is when I let the banner roll its working perfectly but as soon as I start to click every number very quickly the timer get all screw up I dont understand why.? this is the code is use
[Code]...
I am having problems with this function, which is called when a button is pressed. I am loading a JPG with a movieClipLoader into a newly created movieclip, and while this is loading the other is still viewable and is faded and deleted when the new JPG has fully loaded, using the code below:
ActionScript Code:
function loadBigPicture(iValue:Number, firstTime:String):Void {
this.createEmptyMovieClip("myBigPicture"+iValue, this.getNextHighestDepth());
trace(_level0["myBigPicture"+iValue]);
[Code].....
If the button is pressed extremely quickly again and again, the intervals begin to stop working
function onLoad(){
trace("Calling SetInterval");
setInterval(this,"resizeImage",1000);
[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?
I try to use setInterval and Tween Class // Flash 8.One time I move the circle on certain position and second time (what I dont know how to do it) I need to move the circle back on original position.
View 1 RepliesHow do I fix this? With this code in my class:
function moveDelay():Void {
myInterval = setInterval(this.movePoints, delay);
}
I lose scope when it calls the function. "this" becomes undefined.
class actionscript.Time extends MovieClip
{
private var dateTimer:Number;
[code]....
I am trying to write a class that will take a string (provided by a different class) and display it gradually, character by character, as if it were being written by a typewriter. To do this I am making use of the setInterval method in flash.utils, but I'm having difficulties... whenever I test the movie there is no text displayed, but flash isn't reporting any errors.
Here is the code:
package {
import flash.display.MovieClip;
import flash.text.TextField;
import flash.utils.*;
public class TypeWriter extends MovieClip {
[Code] .....
I have this issue where I have a function that when it gets called via a setInterval (or setTimeout as I have tried both), it somehow makes my class vars undefined. I have traced it right before I call the timer, right after and then inside the following function that gets called. See below:
Code:
private function onFrontTireSuccess (evt:Object):Void {
_allowTorqueChange = false;
[code].....
I have this issue where I have a function that when it gets called via a setInterval (or setTimeout as I have tried both), it somehow makes my class vars undefined. I have traced it right before I call the timer, right after and then inside the following function that gets called. See below:
Code:
private function onRearTireSuccess (evt:Object):Void {
allowRandomCars = true;
_scoreboardTimer.reset();
[Code].....
I would like to focus my question on the setInterval and clearInterval use inside a class.
isn't bellow the right way to use it ?
[Code]...
im looking for how to remove a setInterval. i searched but the answer which was supposed to work dident for me.
[Code]...
So I've made a few custom classes before, but I cant seem to get this class to work. All it's doing is making an interlace pattern bitmap graphic.[code]When I instantiate this class via flash IDE using this code:Code: Select allimport com.me.shapes.HorzScreen;[code]I get nothing. No graphic, no errors no output.
View 1 RepliesRecently I added a class (its code is below) in my project but its not working if I open the SWF with Internet Explorer or Firefox, the rest just runs normal, only that class' code doesnt work (unless I open my SWF with Flash).
package {
import flash.display.BitmapData;
import flash.display.BlendMode;
import flash.display.DisplayObject;
[Code].....
I hv am using clock movieclip as class, it have sound tick tock on it's timeline and interval funtion, if I remove child of clockmc but setinterval and sound is still working..i use this code to remove child..removeChild(myclock)myclock= null
View 1 RepliesI am trying to use AMF PHP to pass variables to a flash file, thus far I cannot see anything wrong with my code, but I have very little experience with creating classes, so here it goes, here is my code,
index.php:
<?php
include "amfphp/services/flashMe.php";
$session = true;
[Code].....
Flash is looking for the flashMe class and the push method within that class, but I keep getting null variables in my flash file when I run it
So I'm trying to learn to create a public class, and this is what is in my class file:
class com.RCN.Menu.Menu{
public var title:String;
public var menuItems:Array;
[code]....
and in a seperate SWF I use the code:
import com.RCN.Menu.Menu;
var Accountability:Menu = createMenu("hello",[a,b,c,d]);
trace(Accountability);
yet Accountability traces as undefined?