ActionScript 2.0 :: Unable To Make Dynamic SetInterval Times?
Nov 26, 2010I have a variable called intervalTime, which gets changed. The following code does not work:
Code:
movetimer = setInterval(movebox, intervalTime);
I have a variable called intervalTime, which gets changed. The following code does not work:
Code:
movetimer = setInterval(movebox, intervalTime);
I am making a flash game. The object of the flash game is to use the mouse and dodge the beer bubbles.to start with, the beer bubbles are released slowly, after 10 seconds i want the interval to decrease and the amount of beer bubbles to increase. my code is as follows:
if (cTime <= 10000){
setInterval (makeNewClipB, 1000);
}
[code].....
i'm not reaching this... so imagine 3 clips on stage (ma0, ma1, ma2)every rollOut it sould delay the call of a function, where it should trace the caller clip, and then clear the interval...
[AS]function out(who:MovieClip):Void
{
trace(who);
clearInterval(intTim);
}
for (var i:Number = 0; i<3; i++)
[Code]...
don't know if i was clear, but it seams to me that i need some sort of way to create diferent "processes" for each clip... for example, if i create differet intervals for each clip and then clear each interval individually i can get this to work... but it's sure not code wise.
moveSlide();
myShowInt = setInterval(moveSlide, PLACE A TIME INSERTED FROM AN ARRAY HERE???);
I am trying to make a slideshow from an xml document. Each image has a time attribute, which I have in an array. What I want to do is advance to the next image based on the time associated with it.
i wanna make a dynamic tree using a lazy loading ,each time i open a folder the tree sends a http request to the server, in this script i'm using just static text to test the tree but , i'm getting in the label of the root all the XML text assigned to the dataprovider, then when i open the root folder i got the childs with good labels , and openitem and closeitem events do not fire how could i make them
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLRequestMethod;
[code].....
is there a way to space dynamic text?through actionscript?the letters of my dynamic text are to dense and i would like to change this.
View 14 RepliesI am trying to drag my dynamic moviclips. But this code does not work properly.I have to mosue click the movie clip, and once again use mousepress to drag the movie clip.
clickAction = function (_arg2) {
//info._y += 150;
trace("click"+_arg2); // _arg2 con
[code]....
i'm trying to dynamically layout a calendar using actionscript and i'm no good at determining algorithms to quickly and efficiently lay things out. i was hoping for a litwhat i want to do is set it up per the image attached:* where there are 7 columns and a varying number of rows.* the top row has the 2 arrows and the month and year display.* the second row has all the day headings, i.e. S, M, T, W, R, F, S* and the rest of the rows will have the dates.
View 3 RepliesI'm doing a flash game to go with this song on a band's website (sweet band, by the way (url...)), and the song would be playing during the game, and I want certain events to go with the beat of the song, and that would be so much easier if I could get a metronome on my flash project, and I'm running into problems with that.
I can't get an object to flash exactly 154 times every minute, because the song plays at a constant rate of 154 beats per minute. It's always a little bit off, so that after about 30 seconds, it ceases to be on beat. The object that I want to blink is called "blinker." Here is my actionscript:
Code:
var beatTimer = new Timer(60000/154); // A timer for how often I want it to appear (154 times every minute, or 154 times every 60,000 milliseconds)[code].......
I use the following function to make a few mc's visible on the stage with a setInterval.
[Code]...
I have a site that plays either .mp3 or .flv files depending on what is selected from the menu. Menu loads in from xml. I get "unable to make connection with server or unable to find flv on server" when I try to play the video. But the video and audio files are all in the same directory and the mp3 files play fine. I think I'm having a problem with the setMedia command. Here's the code that loads the video and audio files.
[Code]...
I am trying to duplicate an MC 11 times - that works fine. But the MC has a dynamic text box centered on it. I would like the first one to say "1900" and each one after to be increased by 10. So the second one says "1910", the third says "1920" and so on. I have this code on an MC called "timeline". The MC I am trying to duplicate is called "bar" and is with "timeline":
[AS]
onClipEvent(load){
for(i=0; i < 12; i++) {
_root.timeline.bar.duplicateMovieClip("copy"+i, i);
ext = _root.timeline["copy"+i];
ext._x = 125 * i;
[Code] .....
but to no avail. The dynamic text box on the bar MC is called "year". I have tried making that the var as well as the instance name and still no luck.
how can i make 1 movie clip appear 50 times radomly from above the stage.
View 3 RepliesWhat i need to know, is how to make create random instances of the objects falling (as seen on footer) , so i need to figure out how to create random instances and random times in which they fall.
View 1 Replieshow can i have one movieclip but make it multiply alot times with a max number like maybe 10??
View 1 RepliesI need to make the whole ad repeat X number of times and then stop on the last frame (it always stops in the first frame for me) then I need to link the clickable button to go to a website when clicked. [URL]
View 4 Replieshow can i make a function example() be repeated 5 times with a delay of 3 seconds in between?
View 8 Repliessorting out the lowest times (tid) and put them at the top of my scoreboard. All my scores are saved in a XML document and this is the code in the AS that puts the text into a textfield called "content_text".
[Code]...
I have a flash piece that I want to loop 3 times and then stop.
View 2 Repliesim looking for how to remove a setInterval. i searched but the answer which was supposed to work dident for me.
[Code]...
i'm new to AS3. how do i go about executing a custom function n number of times and then executing another function n number of times repeatedly?
eg.
function firstOne():void { }
function secondOne():void { }
i need firstOne() executed say 3 times and then secondOne() 3 times and then firstOne 3 times again and so on. i'm trying to move a movieclip 3 times to the left and then 3 times to the right continuously.
I loaded an mp3 dynmically into my movie doing the following:
firstSound=new Sound();
firstSound.loadSound("math.mp3", true);
playing=true;
[code]....
I would like to know if it's possible todo something like this:loadVariables("script.php?id=<? echo "id"; ?>",0,"POST"); // the echo thing is nonsense I know, but is it possible to paste the $id, that I'm trying to pass to the external script, from my adressbar (browser)?
View 2 Repliescreate a picture gallery with XML. There is a loader progress which simply displays a percentage when you click on any image. I have been trying to fomrat this text but with little luck. I am able to apply colors to the text but unable to change the font, size, weight etc.
Here is the text with a color applied
Actionscript Code:
fullPreloader.onLoadStart = function(target) {target.createTextField("my_txt",fullImage_mc.getNextHighestDepth,230,300,300,300);target.my_txt.textColor = 0xFFF;};
[Code].....
I've learnt ActionScript basics from this forum and i hope i get a solution for my problem.I am doing this window shopping gallery for my company but iam stuck in the middle of nowhere.I am attaching the files so that u can have a look at it. the gallery is xml driven.
when a user hovers to the left side of the gallery tween starts and the stores move in a perspective angle. i am placing the code here for xml loading which is in 1st frame[code]...
I'm working on a project that dynamically loads news articles.There is basically a title text box and a news box, both are the same width.I would like to know if there is a way that I can get the dynamic title to scale up/down in font size to fit the width (and also shift the news text down to be about 3px under the title)
View 1 RepliesI know I need to embed the font and declare the font in a setFormat string.
Code:
this.createEmptyMovieClip("cat",this.getNextHighestDepth());
cat.createTextField("txt",this.getNextHighestDepth(),0,0,100,50);
var my_fmt:TextFormat = new TextFormat();
my_fmt.font = "Times";
cat.txt.embedFonts = true;
cat.txt.text = "cat";
cat.txt.setTextFormat(my_fmt);
cat._alpha = 50;
I need to be center htmlText loaded from XML into an autosize textfield.I've already tried to edit format, autosize center, but it stay at left.
Code:
var myFont2:Font = new Font2();
textFormat2.font = myFont2.fontName;
[code].....
I'm making a piece of flash used for a website banner, previously i've had very little experience with action scipt as i've made various animations only having to use simple functions such as "stop()" and i've made a never ending scrolling menu also, but now i want to have an event that "onPress" a small animation is played where the mouse clicked the banner. What would be the appropriate script to link the .swf i make to the "onPress" command?
View 5 RepliesSo i have a really nice flash gallery that i downloaded from a site but i am trying to personlize it. It uses a dynamic text (for the preloaders and the titles) which is post by this procedure :
fullPreloader.onLoadStart = function(target) {
target.createTextField("my_txt",fullImage_mc.getNe xtHighestDepth(),50,50,200,20);
target.my_txt.selectable = false;
};
So what i did was basically to create a new style (my_fmt) and apply it to dynamic style applied by default (my_txt) :
fullPreloader.onLoadStart = function(target) {
target.createTextField("my_txt",fullImage_mc.getNe xtHighestDepth(),0,0,200,20);
target.my_txt.selectable = false;
[Code]....
Anway nothing changes. The text is always the same (Times New Roman which is by default) I also tried to change de height and width definitions but no difference. It only works when i change the x and y position of the text.