ActionScript 2.0 :: SetInterval With A Class - Function Doesn't Work Inside Class ?

Oct 7, 2004

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.

View 5 Replies


Similar Posts:


ActionScript 2.0 :: Function Called By SetInterval, But Doesn't Work?

Dec 14, 2009

I have a function ("advance_slideshow()") that ticks a slide show up by one, then it loops back at the end. It works when called from the key listener I set up for debugging. However it does not work when called from setInterval. I added a trace to the function to confirm that it was being called, which it is; it just doesn't work when called via the interval

Code:
//////////////////////////
/* IMPORTS AND INCLUDES */

[code].......

View 1 Replies

Professional :: Copying A Class - Frame 4's Class Doesn't Work?

Oct 3, 2011

I copied my actions from frame 3 to frame 4 and frame 4's class doesn't work when frame 3's class works fine and normal, here is the source code:

Frame 3: 
stop();
var rowNum:int = 10;
for (var i:int=0; i<rowNum; i++)[code]....

View 7 Replies

ActionScript 2.0 :: Syntax For SetInterval Inside Class?

Apr 30, 2008

class actionscript.Time extends MovieClip
{
private var dateTimer:Number;

[code]....

View 3 Replies

ActionScript 3.0 :: Calling A Function From An Extended Class Inside A Top Level Class

Sep 23, 2009

package{
public class Character{
protected var _hp:uint = 50; //Character Health Points
protected var _power:uint = 5; //Damage dealt

[Code].....

I`m instancing a Character and a Player in the Main Timeline, all in frame 1.
When I use: ""player.attack(character)"" it works fine by itself.

So I added the if (defender._hp <= 0) this.win() which gives me the following error:

1061: Call to a possibly undefined method win through a reference with static type Character.

"defender" is a Character instance, "this" is a Player instance and "win()" is a Player method. I try to call the Player method inside a Character method using the Player instance adding the "." and his method name

Do I really need to define the win() function in the Character class? Is there a bypass to use a subclass method in a parent class method if it`s called from an instance of the subclass?

View 6 Replies

ActionScript 2.0 :: Focus Question On The SetInterval And ClearInterval Use Inside A Class

Jul 13, 2006

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]...

View 2 Replies

ActionScript 3.0 :: Use A Function From A Doc Class To Call A Function To Work On In Another Class?

Dec 15, 2009

how do use a function from a doc class.... to call a function to work on in

[Code]...

View 2 Replies

ActionScript 2.0 :: Call Function Using SetInterval From Another Class?

Feb 4, 2009

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?

View 3 Replies

ActionScript 3.0 :: Movieclip (root) Doesn't Work Inside A Function?

Aug 4, 2011

In fact, when i publish my FLA with player 9, there is no prob. When i publish with selecting player 10, there is this problem.
 
I paste my code :
 
var leng:int = MovieClip(root).program.websiteXML.pages.titlePage.length();
trace ("leng"+leng);
setInterval(function () : void {

[Code]....

View 11 Replies

ActionScript 2.0 :: Motion Tween Doesn't Work Inside Function

Jul 10, 2008

I made a motion tween that works great on it's own, but won't tween at all inside of a frame. Why not?Here is the code as a function. What's up?:

Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
fadeIn(myMC);
fadeIn = function(mc) {
var myHoriTween:Tween = new Tween (mc,"_x",Back.easeOut,900,0,1.1,true);
}

View 1 Replies

ActionScript 2.0 :: Draw With Path Class Doesn't Always Work

Mar 29, 2009

So, I'm using this Path Class to make a path and then draw it. I'm having a problem where there are some positions that I draw the path, the entire line does not draw.You can see an example of this here as the dot moves. The line flashes at a few coordinates. Just a small concept example I made. The path is there, it's just not being drawn.

The code :

Code:
import com.senocular.drawing.Path;
// create a path instance that draws in _root
var myPath:Path = new Path();

[code].....

View 2 Replies

ActionScript 3.0 :: ExternalInterface Class Doesn't Work In IE Instead It Outputs 0?

Aug 5, 2009

[Code]....

this works in FF and outputs 600 like expected and it doesn't work in IE, instead it outputs 0??? why is this handled differently in different browsers?

View 5 Replies

ActionScript 3.0 :: Beginer Class Mcp Inherit The Mc Doesn't Work

Jan 25, 2009

Runtime error at the line : var mcp: MovieClipPlus =
MovieClipPlus(mc);

It doesnt work.. how can I let mcp inherit the mc?

View 2 Replies

Professional :: Import Of Custom Class Doesn't Seem To Work

May 30, 2010

OK, I have my custom class defined in a file called "rootInstace.as". This is what it contains:
 
[Code]...

View 3 Replies

ActionScript 3.0 :: Flash Class Doesn't Work After Published

Oct 9, 2010

I created a class for showing a Alert Message Window, everything is working OK while I executed it from Flash, but when I published it I can't see nothing... I tryed in differents browsers, I tryed from localhost, uploading to an internet server, creating crossdomain.xml file in the root server, turning to "Access network only" the Flash Publish preferences... and nothing yet.

Here the class

Code:
package com.nuedi.ui
{
import flash.display.Bitmap;
import flash.display.BitmapData;

[Code].....

View 9 Replies

How To Get Preloader To Work Inside Class

Nov 6, 2009

I am very new to flash and on the net I've found a class that allows me to use a nice scroll bar for the content. My problem is that I can't get a preloader working with the class. When I want to add scrips to the frames it bugs the class if I try to implement the preloader inside the class I can't get it working. Here's the class I am using for the scroll bar. - if you want to test it, it will require additional data. You can get it all here: [URL].

package{
import flash.display.*;
import flash.text.*;
import flash.events.*;
import gs.TweenLite;
import com.warmforestflash.ui.FullScreenScrollBar;
public class Main extends Sprite{
[Code] .....

If I try to insert the preloader script inside the class it has problems with the stop(); & play(); commands. Any way to get a preferably simple preloader working with the class I am using?

View 1 Replies

Actionscript :: Shared Object Doesn't Work In Separate .as Class?

Aug 28, 2009

bit of an odd problem, I have the following piece of code

Code:
var myCookie:SharedObject = SharedObject.getLocal("mySavedData","/")
if(myCookie.data.mySavedText != undefined)
{
var gallerypath:String = myCookie.data.mySavedText;
}
which retrieves a shared data.

If I put this actionscript on the first frame of a new document, it works fine, however I want to use it in something I already have, which uses an external Document class.

[Code]...

View 1 Replies

ActionScript 3.0 :: Singleton ENTER-FRAME UpdateList Class Doesn't Work?

Feb 12, 2011

I'm making a class that manages all of my updates with a single ENTER_FRAME. I think I should be getting the OnUpdate trace but it doesn't seem to work?[code]

View 2 Replies

ActionScript 3.0 :: Auto-complete Feature Doesn't Work Well / When Creating New Class File

Aug 3, 2010

For some reason, in the past few days, the auto complete feature doesn't work well when I'm creating a new class file. I'm trying to write a new class which uses away3D, and even though the auto-complete works well when I start a new AS3 file, it just doesn't work as far as away3D is concerned when I try to create a new AS3 Class file. Other features of the auto-complete don't work as well, for some reason.

View 1 Replies

ActionScript 3.0 :: Calling A Function Inside Another Class?

Sep 9, 2009

I have the following two classes and can't seem to figure to figure out how to call a function in the top one from the bottom one. The top one get instantiated on the root timeline. The bottom one gets instantiated from the top one. How do I call functions between the classes. Also, what if I had another call instantiated in top one and wanted to call a function in the bottom class from the second class?

package
{
import flash.display.MovieClip;

[code]......

View 12 Replies

ActionScript 2.0 :: Call Function Inside A Class?

Oct 25, 2005

I've got some problems trying to call a function inside a mc in a class.For example:

Code:
class Foo {
private my_mc:MovieClip;

[code]......

View 3 Replies

ActionScript 3.0 :: Class Function Didn't Work On .swf ?

Feb 16, 2011

I'm now learning about class function on AS3, and I have little problems that may appear as a noob question, but I have searched everywhere else, and still found nothing.I make a function class separate on .as file, then I call the class fuction to attached the class function to a MovieClip.The class function working fine when I tested on TestMovie ( Ctrl+Enter ) The movieclip can be dragged.but when I double clicked it from .swf file (from windows explorer) , the movieclip function didn't work at all? And it works well also on .EXE file, just didn't work on .swf file ?

View 1 Replies

ActionScript 3.0 :: Events Dispatched By The Class A Doesn't Get Listened By The Main Class?

Feb 2, 2010

I have a main class which listens for an event dispatched from another class say class A. Also there are other classes say class B, class C etc.There is a controller class.Classes B, C dispatches events that gets listened by the controller and works well.But the events dispatched by the Class A doesn't get listened by the main class.What might be the problem. Detailed Explanation of the problem.There is a main mxml file.

Class files are in:
ProcessInput.as
DBController.as
ShortMemDB.as ....etc

The main mxml file gets the input from a textArea. Sends the input to the capturedInput (input:String) function using set method which is in the ProcessInput Class.Now I need to dispatch events NORMAL, COMMAND depending on the input obtained after the processing, where I'm having problems. The reason is that if the event NORMAL is dispatched a particular function inside the DBController is to be called. If COMMAND event is dispatched then I need to call another function. This idea doesn't work since the events doesn't get listened.But the events dispatched by the CSDB class when listened by the DBController works well.

View 7 Replies

ActionScript 3.0 :: Extended Class Doesn't Inherit Base Class Imports?

Sep 29, 2011

Let's say Class A has the flash.events.Event imported. Now let's say Class B extends Class A. Why in the hell do i need to import flash.events.Event in Class B? It makes no sens at all to me.

View 3 Replies

ActionScript 3.0 :: Call Function Inside Running Class?

Jul 14, 2010

1- i have class and i called its before and its running on runtime. i need to call function inside this class from another class, but without call the first one again, because if i called it, it will run default class function again is this doable ?

2- What super() mean ?

View 4 Replies

Flex :: Call An External Function From Inside A Class?

Aug 1, 2011

i want to call an external function inside a class. thats the code;

in checkConnectionStatus function,

this[_funcNameForSucceededCon].apply(); doesnt work because "this" is the class, not the Application. How can i reach Application at this time or what can i do?

package myLibrary
{
import air.net.URLMonitor;
import flash.events.Event;

[Code]....

View 1 Replies

Flash :: Use A Method Of A Class Inside A Callback Function ?

Sep 13, 2011

When you call a method of a class inside a callback function, you can not use this object.To call the method, in javascript, I declare that variable, assign this to that, and use that inside the callback to call the method of this.In actionscript, do I have to do the same way as I do in javascript?The following code is the example to use that to call a method inside callback.Are there more simple way in actionscript?

class C {
private var that:C;

function C() {[code]......

View 6 Replies

ActionScript 2.0 :: Reffering To This From Function Defined Inside Class?

Jan 18, 2006

Code:
class className () {
//constructor
function className(targetmc,linkId) {

[code]....

My question is how can I set up an interval when I click on a button that is created from within the class.

I need my function updater to keep repeating untill I clear the interval.The only way I can figure out is to give the full path like this._parent._parent.instanceName.updater inside the setInterval, but although this works I think is just dumb to hardcode the instace name of the class. I could of course try to pass the instance name as a parameter, but I would really love to find out the smart way to do this (by the book).

View 3 Replies

ActionScript 2.0 :: DispatchEvent With A Function Declared Inside The Class?

Jan 19, 2007

I've got a class where I'm using:

o.type = "focus";
o.target = "this";
dispatchEvent(o);

and then focus is a function of an object in the FLA.

I want focus to be in the AS External Class file but it won't trigger.

View 3 Replies

ActionScript 2.0 :: Scope : Function Call From Inside An Object In A Class?

Feb 7, 2009

I have an object and would like to call a function from it, which the way I am trying to do it, does not seem to work. Here is what I have:

Code:
private function setTimer():Void
{

[code]......

View 0 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved