ActionScript 2.0 :: Setting Interval For Dynamic Buttons?
May 31, 2008Code:
for(i=0;i<folderNamesArray.length;i++){
current_y = this.mc_folderButton._y;
[code].....
Code:
for(i=0;i<folderNamesArray.length;i++){
current_y = this.mc_folderButton._y;
[code].....
[Code]...
i'm making a dynamic folder buttons... the above code i did ran successfully... now i want the dynamic buttons to display like at 1 sec interval between each button.. where and how do i insert the setInterval method..?
i have it when you land on the "ground" a dust cloud spawns, and goes away. Now i got that part under control, sometimes the "player" MC glitches and moves ever so slightly up and down unnoticeablly if it was for the dust cloud, Now my question, how would i go about setting an interval for the duplicated moveclip?
View 1 Repliesmy code looks like this:
Code:
function playit(){
_root.gotoAndPlay(4);
[code]......
my code looks like this:
Code:
function playit(){
_root.gotoAndPlay(4);
}
setInterval(playit, 58900);
It works nice when i play the movie, but when i load it from my main movie it doesnt works (obvious, "_main" changes to be the movie that is loading). Now, i used "_parent" but it doesnt work, "this" neither; so, thats my problem, when i load the movie with this code inside, into another movie it won't work. =(
I need to have a SO expire after 30min and I cant figure it out in as3? Set interval? Get time? I'm new to as3.
View 1 RepliesI have a problem with setInterval. I have a button; when you press the button three movie clips fade in and slide across screen. When I set the script so the mc's move without button input, everything is fine. But when I try to set it up with an onRelease handler, BLOOIE!
[Code]...
I am having an issue with adding dynamic content through an interval. The content is being added to the screen, but the X position, as well as the tween, seem to be completely out of sync. The below is a screenshot when the interval is at 100 milliseconds, as it shows it best. The application needs to work at 200 milliseconds (where the error is not as clear, but the lines are still occationally too close, roughly every 4th). As can be seen, there is a clear discrepancy between positioning. It remains fine for a few, then changes, changes again and then finally reverts back to what it was.
Here is my code that controls this section:
function XYZ(){
Score = 90
var timeBefore = Score
if(timeBefore <= 2.4){
timeBefore = 2.5
[Code] .....
Note: It also happens with 200 and 300 milliseconds, although less prominent.
i have a problem with the setInterval and clear Interval function with in a movieclip i created. the interval seems to still be running even though it is with in a movieclip and not on the main time line. how do i stop it from affecting the buttons on the main time line. i tried applying the clearInterval function to the button on the main time line but still no change.
View 1 Repliesi'm kema and i have a problem with the setInterval and clear Interval function with in a movieclip i created.the interval seems to still be running even though it is with in a movieclip and not on the main time line. how do i stop it from affecting the buttons on the main time line. i tried applying the clearInterval function to the button on the main time line but still no change. i would be very grateful if anybody can profer a solution to this problem,
View 1 RepliesI have a movie clip and in that movie clip there is a dynamic text box. I want that text box to display a dynamic variable name something like:
Quote:
_root.var_[this._name]
so the variable will be _root._var plus what ever the instance name of the movie clip it's in is, how can i do this?
I'm completely new to this forum, and would like to ask your help for one issue. I am working on an interactive flash map, I was able to set all the countries borders with the help of fireworks (awesome tool), and import them back to flash and set each country as a button. I would like to set all of the buttons to have the same properties for example : All the buttons have default red color, and will have a mouse hover frame that will change the color of the button to blue. I DO NOT want to set each button manually, because I would like to have the choice to change the mouse hover color to a different one, and would like to avoid passing each button and changing each one's mouse hover frame.
Is there a way I can built a template of a frame, and for each button set its mouse hover frame as the template frame I built ? And then if I make any changes to the template frame, all of my buttons would be automatically updated ?
I have tried repeatedly to take the examples in setChildIndex and instead of using sprites I want to control the order of 2 buttons on the stage so that when I roll over one of the buttons it comes to the top.
Here is the code I have so far which is from the example given in the on-line documentation:
[Code]...
If the answer is yes then a needle on a separate movie goes closer to the red(right) and if the answer is no then the needle stays where it is. This was all fine until the user ticks yes then changes their mind to no... the needle would then stay where it was rather than going backwards(towards the green) because I had set it up to not do anything if the no button was pressed initially? I was told that setting up the buttons as arrays would be the best option but on trying to learn about arrays I've become completely confused? oh additionally the amount of ticks dictate certain events that happen to the needle movie so they need to trigger events some how?
View 4 RepliesI am working on an interactive flash map, I was able to set all the countries borders with the help of fireworks (awesome tool), and import them back to flash and set each country as a button.I would like to set all of the buttons to have the same properties for example :All the buttons have default red color, and will have a mouse hover frame that will change the color of the button to blue.I DO NOT want to set each button manually, because I would like to have the choice to change the mouse hover color to a different one, and would like to avoid passing each button and changing each one's mouse hover frame.
Is there a way I can built a template of a frame, and for each button set its mouse hover frame as the template frame I built ? And then if I make any changes to the template frame, all of my buttons would be automatically updated?
I have pages of info I'm pulling from external files. I want my btn_next to not be visible when the last page loads and my btn_prev to not be visible when the first page loads. The btns are actually moviclips with instance names btn_next and btn_prev Here is my code:
//Stage Scale
Stage.scaleMode = "exactFit";
width_txt.text = Stage.width;
[code]....
I have a movie clip, behind a mask, and I am trying to control the position it moves to, dependent on the menu button pressed.
If I am honest I am trying to copy the effect used in www.lostinbeta.com when pages are loaded.I have got everything working, but currently I do not know how to set the finishing x position depending on the button pressed.
I think the issue is becuase I am trying to use the technique to make the movement slowdown as it reaches its correct co-ordinates.
it's an easy question but the words may come out wrong. so I'm loading these 5 pics as buttons
[code]...
and I want to have them located one below the other plus 10 pixels gap . . . it seems so easy, but then so did opening the MX2004 packaging . . . 3 days later.
i found i can get vertical dynamic text block by setting to vertical and then to dynamic. But, then it ends up being horizontal, and if inside a clip, only the letters over another item in clip show. Like veritcal text on a vertical bar gives only the 1 or 2 letters that fit across bar, rest truncated. i've tried embedding text to get this far, but still doesn't work 'all the way' i see online they talk about all scripting for dynamic, vertical text; is that necessary, or am i missing something??
View 1 RepliesI'm currently trying to build my first flash site.I have just set up the buttons which get to each 'section' via frame labels and the AS3 gotoAndStop function.These work without error until my 'sections' contain movieclips that are referenced in my actionscript layer... Because they do not exist in 'all frames', whenever I click my buttons I get the error, "Error #1009: Cannot access a property or method of a null object reference."It took me a while to understand and track down why I was getting this. I removed the short bit of code in my actionscripts layer that referenced the movieclips in each section (I had some custom scrollbars set up) and it worked without error.
View 2 RepliesI'm using Flash Remoting to grab a result set from a SQL Server database. Then, using the total records in the result set, I'm creating the respective number of movie clips on the stage. Each of these movie clips is an instance of the "button_mc" movie clip I have in the library, named "button_0", "button_1", ..."button_n". The library movie clip that I'm using to create the instances contains a standard Flash button.
Anyway, that part is working fine. What I want to do is dynamically generate the onRelease event handler for each of these unique buttons. When I try to do this within the for loop, it sets all the event handlers to the last item in the list. What I want to do with the event handler is change the text of a dynamic text field based on the button name.
e.g. buttonName.onRelease = function() {
myDynamicTextField.text = "button_"+i;
}
In some ways it makes sense that the event handler is always going to be the last available in the loop, as the handler is called after the loop is completed. However, I'm hoping there's a way to make the handler "stick" after the loop is completed.
I have 3 textfields. they're in a sprite container. 1. date 2. pipe_mc movieclip 3. title field. I need to set it so that the textfield/mc/textfield;s x property changes dynamically when a shorter or longer date gets added into the field, via XML.
[Code]....
I've a flash template and the variables are editable in XML files. I need to define a gradient on dynamic text, Here's the code in the flash actionscript that i think it's linking to xml:
/*
we color the item elements
*/
[Code]....
anyone has ideas for defining a linear gradient?? i've researched and try somethings but this is really not my field, and I seem to keep failing.
I'm trying to create a dynamic text field which displays the first number contained in an array named _root.arr. I set var to "_root.arr[0]" to catch the first number in the array. Unfortunately it doesn't work because it shows just a blank text field.
I've also noticed that if I just set var to "_root.arr" all the numbers contained in the array will be displayed separeted by a comma.
So, how can I just display the first number in the array?
I am having problems with the _alpha property of dynamic masks. For some reason they don't seem to accept it. I have a holder mc that I use as a mask and the holder is full of dynamic mcs for which I would like to set apha properties. My code is:
[Code]...
Why won't this work?
Code:
var galleries = this.firstChild.childNodes;
for(var i=0;i<galleries.length;i++) {
[code].....
When using dynamic text and you set the text alignment to "align right", the text is supposed to flow right to left correct? With my code below I can't seem to get this to happen. All my text is flowing left to right.
Code:
// change title
_global.changeTitle = function(title:String) {
// set title text
_root.vid.title.autoSize = true;
_root.vid.title.text = title; };
changeTitle("A Global Industry");
Is there a way to display text in a dynamic text field taken from a input text field?
View 5 RepliesI'm updating an old Flash file and I'm pulling some dynamic text into a text box, but I'm having a really, really hard time trying to get it to resize the width so it always fills the box, which is 170 wide.
myText.textWidth=170;
myText.width=170;
myText._width=170;
none of it seems to work.
I can't get the code to "know" which of the dynamic thumbnails has been clicked (by "know", I mean return an index value, say 0 through 7 if there are 8 projects, that I can use to access that particular project in the array of 8 projects in the rest of the code)... So if the third movieclip thumbnail were clicked, I'd like "2" to come up somehow... I've tried this code, which is kind of lame, I know, based off of the idea of each of the thumbnail movieclips' names ending in their index number:
Code:
//"this" is the button that was pressed; would return a string ending in
//thumberMC_<number of whichever movieclip thumb was clicked>
var: testString:String = this;
[code]....
Lastly, there's a dynamic textfield I'm trying to create that never shows up for some reason. Again, you could see in the FLA (in the "createDrawer" function around line 424).