Flex - Calling A Function Once Then Repeated At A Set Interval?
Jun 23, 2010
I have a function which makes a call to the server to load some financial data. This data is then displayed in a grid. In order to keep displaying the latest data I keep making this server call (every 30 secs). I'm using a Timer object to do this. The problem I have is that I have to wait 30 secs when the application starts for financial data to be displayed, what I'd like to happen is that the load data call is made, then start the update timer. Is there a way to set this up or shall I use to data load calls, one to get the initial data, then one to get the updates, which is made every 30 secs?
View 1 Replies
Similar Posts:
Aug 7, 2009
How to set an interval before calling a function?
View 1 Replies
Jan 30, 2009
How do I pass a variable to function when calling it with interval.
This:
Code:
doFlip(1);
to something like this:
Code:
myInterval = setInterval(doFlip(1),2000);
View 2 Replies
Dec 2, 2009
I'm an interior architect at a small architecture firm and I have been tasked with updating the firms website. I have no prior experience with flash, but have been able to learn enough to update all expcept for the portfolio section. For some reason, when I add three additional frames to the portfolio gallery timeline, it repeats the previous three frames before playing the new three. This happens only when I publish the file, when I run the timeline and view it on the stage everything appears fine.
View 3 Replies
Apr 14, 2009
Right now, I have a gallery with many different thumbnails each individual movie clip symbols and not button symbols and each movie clip has a rollover and rollout function assigned to them which are all basically the same for each thumbnail.
Following is an example from a small section of the gallery thumbnails.
web04.btn04.onRollOver = function() {
this.gotoAndPlay(2);
};
web04.btn04.onRollOut = function() {
[Code]....
The above shows two groups of thumbnails grouped into individual movie clips (web01, web02, web03) each movie clip containing 3 thumbnails (btn04, sub04_1, sub04_2). I had done it this way for grouping and ease of animation.
I was wondering if it was possible to create just one function which executes the rollover and rollout functions so the script window would not be filled with so much repeated script.
View 1 Replies
May 13, 2009
I am creating a driving game using the following method to drive the car forward: if (Key.isDown(Key.UP)) {speed += 1;} I also want to call a function when the key is pressed athough if I add a function call the function gets repeated as long as the key is pressed and I only require it to run once?
View 1 Replies
Dec 26, 2005
how can i make a function example() be repeated 5 times with a delay of 3 seconds in between?
View 8 Replies
Jul 27, 2009
package asas
{
public class main extends EventDispatcher[code].....
I have this class and a MXML file... how will i call the function doCheck in button. When i call like this, it throws me an error.
<mx:Button
styleName="LoginButton"
id="loginButton" [code]...
View 2 Replies
Dec 19, 2009
How can I call a function in file1.as from file2.as?
here is the code.
package com.modestmaps
{
import com.modestmaps.overlays.MarkerClip;
import flash.display.Graphics;
[Code].....
in this package i am attempting to add the shadow, which works, and then add the infobubble, which works, and then add a main swf which works, and then add a close_button.swf which it does load the swf; however, when I try to add the listener, I am unable to make the infobubble close back up.
View 2 Replies
Oct 19, 2010
I need to call javascript function from Flash 4 based web application. When I run it in Debug mode it runs perfectly but when I make release build or run same application on other machine it does not call JavaScript function.
[Code]...
View 2 Replies
Dec 23, 2009
I am embedding a swf file into the parent swf file and my code in parent swf file want to call the function inside the embedded swf file. It always failed, below is the code. The error is in line:
var player:testflv1 = (loader.content as SystemManager).application as testflv1;
It can't be compiled because the testflv1 is not recognized as the known type.
[Code]...
View 1 Replies
Oct 12, 2011
i am trying to call a function which is defined in main.mxml
public function btnAcceptCall_clickHandler(event:MouseEvent)
[Code]...
View 3 Replies
Dec 5, 2011
I hope I have worded the question ok. I know that you can pass the 'id' of the component but I'm just wondering if there is a more generic way. I have tried using 'this' (shown in example below) but the 'this' keyword refers to the application.
[Code]...
View 1 Replies
Dec 20, 2010
In my main application I have a viewstack with 3 child views. In the viewstack change handler, I programmatically change the selectedchild property.
I understand that the initialize method for the view is not called every time I change the selectedChild Property. So I tried to invoke the init method programmatically too..
view1.mxml
<fx:Script>
<![CDATA[
[Code].....
View 2 Replies
Jun 30, 2006
Can I clear a interval in a function from another function?[code]...
View 2 Replies
Mar 26, 2009
I have a simple movice clip, 72 frames. On Frame 42 I have this actionscript
//----------------------------------
function wait2() {
stop();
[Code]....
and a few other "possible" solutions I found on the web....but nothing works. If I click the damn button...
View 2 Replies
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
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.
[This is Flash 8, AS2]
Code:
//////////////////////////
/* IMPORTS AND INCLUDES */
//////////////////////////
import mx.transitions.*;
[Code].....
View 4 Replies
Jan 11, 2011
how can i make this replay button? i need to kill the "delays" at function. how can i make this?[code]
View 1 Replies
Jun 21, 2011
If I need to call a specific function in the parent application from a child in a flex project, what's the best practice for this? Would it be to dispatch a custom event from the child and have a listener call that function? Or to directly call the function with FlexGlobals.topLevelApplication?
View 1 Replies
Dec 2, 2010
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 7 Replies
Jul 16, 2010
How can you change the interval passed to the setInterval function?
I've tried for hours but it seems to trigger the function a million times.[code]...
View 7 Replies
Apr 29, 2009
In AS2 I use an interval function to make the movie stop in a specific frame for x second and they play again Example:I add this code on a specific frame 1:
var count:Number = 0;
var maxCount:Number = 35;
useHandCursor = false;
[code].....
View 1 Replies
Jul 1, 2004
I've got function that I call using setInterval. The problem is I need to call that function on an interval faster than 1 millsec.
View 4 Replies
Oct 24, 2005
what i'm trying to achieve is to be able to create a random time frame betw 1 to 8 seconds before it calls a movie clip from the library.
Code:
function layEgg(hens) {
//set random time in sec
var timeGap = Math.floor(Math.random()*(8+1))+1;
[Code]....
however the time interval is not working. i managed to trace the random timeGap.
View 11 Replies
Mar 2, 2010
I'm getting stack overflow errors when I'm trying to publish() a NetStream after close()ing it. Pasted below is the error stack:[code]
View 1 Replies
Sep 23, 2011
I have an AS3 function that loads and audio file and then plays it. I have the pre-loader for the first audio file working - now I need to run the pre-load function before the 2nd audio file starts.
myMusic.addEventListener(ProgressEvent.PROGRESS, onLoadProgress2, false,0, true);
myMusic.addEventListener(Event.COMPLETE, playMusicNow, false, 0,true);
myMusic.load(soundFile, myContext); //This code works
[code].....
View 2 Replies
Feb 26, 2010
i'm trying to modify some code and can't figure out what the issue i'm having it. this is the(shortened) code:
public static function Lose():void {
trace("OVER!");
Clock.stop();[code]...
this is the error i get: 1180: Call to a possibly undefined method OverIt.i just want to call a function from inside of the public static funtion.both function are inside this class:
public class Game extends MovieClip {
}
View 4 Replies
May 12, 2004
Okay so I am reading through sens tutorial on OOP and updating my game that I am making. It is much easier to code this way (IMO) but still hitting snags.I am trying to get through this code:
[Code]...
View 3 Replies
Sep 27, 2011
i have defined some functions in a component mxml file let us say addbutton() now i want to call this function in main mxml file.
View 2 Replies