ActionScript 2.0 :: Cant Get A Loop To Work?
Jul 28, 2011I have 16 (movieclips mc1, mc2...)i want to be shown onRollOver 16 different buttons (panel.star1,panel.star2..
[Code]...
I have 16 (movieclips mc1, mc2...)i want to be shown onRollOver 16 different buttons (panel.star1,panel.star2..
[Code]...
I have a movie clip "picture", which has different pictures in different frames. I also have a button to make the picture go to a given frame for every frame. There are so many buttons that they won't fit into same "page", so I have a movieclip "buttons" which has buttons on different frames. As I have hundreds of frames in the picture it'd feel silly to put
PHP Code:
on(release){
_root.picture.gotoAndStop(frameNumber);
}
[Code]....
The code works for the first frame of the buttons movieclip, but when you go to a new frame it stops working. And if you return to the first frame it won't work there either any more. Is there anything I could do, or do I have to put the for-loop in every frame of the buttons movieclip (replacing "_root.buttons" with "this")? It'd be a lot of work, since I have quite a many frames in the buttons movieclip as well.
I am trying to make an existing Flash movie on a site I'm working on loop playback. Most instructions I found on this said to use:
<param name="loop" value="true">
but this does not work when I try to play the movie. I assume something else in the code is conflicting. This is the code for the Flash Player:
[Code]....
Ive been struggling with this:
import com.greensock.TweenLite;
import com.greensock.plugins.*;
import com.greensock.easing.*;
[code]......
I've got something simple in my main time line. I know I must be missing some kind of loop function, as the hold down doesn't work unless I keep clicking. And my trace doesn't work unless it starts on the 'enemy'. I'm just not sure what
Code:
import flash.events.MouseEvent;
_left.addEventListener(MouseEvent.MOUSE_DOWN, moveLeft);
function moveLeft(e:MouseEvent){
_hero.x--;
[Code] .....
I have used the script below to loop my movie 3 times, many times before.I just made a new banner and put this same script in a keyframe at the end of the movie, like all the other times, but it is now giving me an error messages..see below.
View 3 RepliesSee attached file:Why doesn't this work
View 2 RepliesMy FLVPlayBack integratino doesn't work : menu don't show, the video don't loop .
It's here :
[URL]
And the code generated by flash CS5 pro :
<div id="flashContent">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="385" height="282" id="pic-du-midi-fevrier-2011" align="middle">
<param name="movie" value="videos/pic-du-midi-fevrier-2011.swf" />
[Code]....
I have some simple code:
function testing(){
for (a=1; a<=4; a++) {
this["btn"+a].enabled = true;
}
}
If i run this function from anywhere it works fine. If i run this function from myTimer = setInteval(testing, 3000); it will not work. If i add other random code into the function it (the newly added code only) will work. So i have narrowed it down to something about this["btn"+a].enabled = true; specifically that is causing it to not run.I really hope this makes sense, appologies, it's 3am :
I cant get addChild to work withing a loop (while).
I have a range of movie clips in the frame hidden away. These are called item_1, item_2, item_3 etc.
It works FINE when Im adding say item_1, then item_2, but if the code tries to add "item_1" twice, it seems to just overwrite the first new "item_1"!?!
This is what I need to do, and it just wont work!
ActionScript Code:
while(i<10){
this["item_new_"+i] =new MovieClip();
this["item_1"].y = 0;//I put this in just to make sure they line up right
[Code].....
i put this in actionscript
on(release)
{
getURL("htt://glennbeyer.freeiz.com/unreal.html");
[code]......
I would like to create a loop so the icons in the menu continually loop indefinitly.[code]
View 2 RepliesI am attempting to use a loop to create text field with the loop's current value. The code looks like this:
ActionScript Code:
for (var i = 1; i<=10; i++) {
var 'nameHolder'+[i]+'_txt':TLFTextField = new TLFTextField();
'nameHolder'+[i]+'_txt'.x = 40
'nameHolder'+[i]+'_txt'.y = 40
'nameHolder'+[i]+'_txt'.text = "Hello World"
}
So essentially what it should do is create 10 text fields at 40, 40 with the text: "Hello World".
i'm trying to do an infinate loop for my m.clip.the looping part does not want to loop...it loops back to my firrst frame even though there are two same picture in the movie clip.....here's a sample of what i use for the infinate loop script..
[Code]...
I have need of loops / nested loops that pick different figures depending on where you are in the loop. The whole function needs to run through 'ml' times. 'ml' is a dynamic figure. Loop 1 = While the loop is within the first 12 iterations, 'exconemp' must equal 100. For iterations 13 - 24, 'exconemp' must equal 102.5, for 25 - 36 it will be 105.06, for 37 - 48 it will be 107.69. This needs to change every 12th iteration until it has reached 'ml'. The calculation takes the value of the previous 'exconemp' and then multiplies that by 0.025.
Loop 2 = While the loop is within the first 120 iterations, 'abc' must equal 0.015 and any further iterations must use 0.01. This must also work in a way to figure out whether 'ml' is higher or lower than 120 and work accordingly. My main issue is this - how do I get the loops to run through as this: While the iteration is < 12, do this, THEN take the final figure (12th iteration) and start on 13 - 24, do this THEN etc etc. How do I produce a THEN statement? I can get the code to pick up the final values, but not change along the way.
[Code]...
Say, I had a loop in a function...
[Code]....
How would I refer to a in another function
Should I declare the _mcContainer var before the loop or no? (performance increase?)
for(var i:uint = _startIndex; i <= _endIndex; ++i){
var _mcContainer:MovieClip = _mcParent["i_" + _position];
}
[Code]....
Recently I'd been criticized for structuring my for loops like so:
var i:MovieClip;
for each(i in array)
{
[Code]....
This reads better for me personally, yet I'm being attacked for it. Is there any difference?
basically I need a loop within a loop to compare two different arrays in my actionscript3 lottery game. I have attempted the loop but I cannot seem to get it to work ...
[Code]....
So basically within this code check_win is a button. Once the button is clicked it runs the loop. It is meant to take an instance of matches which contains 6 properties and loop until index is greater than matches. According to my output this is happening but the second loop doesn't appear to do anything.
How do i word a for loop to make it loop through multiple arrays?I want 1 for loop to loop through multiple arrays in order to move/alter objects.I want to keep the arrays separate.
ActionScript Code:
characters = new Array();
characters[0] = male;
[code]........
I'm trying to make a matching pairs game. First of all I'm making all the tiles, using a loop inside a loop. How do I get the ID of an item inside that loop? My code looks like follow:
Code:
var matches:Array=new Array(1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8);
makeTiles();
function makeTiles() {
[Code].....
dayVal = day.value;
for(dayVal = 1; dayVal/7 != 1; dayVal++)
{trace (dayVal);
}
the loop starts at 0 and not 1 so the loop ends at 6 does any one know how to resolve this issue?? its so that what ever number dayVal is it will be rounded up to a number that is Divisble by 7 .
Basically, I have data organized by date in an XML file. I'm trying to make a website application that will allow the user to click on a date (in a text field) to see another textfield populate with all the data under that particular date. So far, all the information loads into the textboxes at the same time. How can I get it to only load information under a particular date when somebody clicks on that date?
Before I started this project, I was convinced I could do this by manipulating the [j] (see code below) in the myFunc2 function. Currently, it's set up to increment blank_mc._y by whatever value is returned by [j]. But for some reason this doesn't work. I feel that if I could atleas get this part to work - I could probably do the rest.
AS code:
Code:
function loadXML(loaded) {
if (loaded) {
var nodes = this.firstChild;
[code]....
I have some code that seems to have a problem. I can't seem to pass the x variable from one loop to within another loop.
Code:
var myLv = new LoadVars();
var myNv = new LoadVars();[code]....
wondering if anyone knows if its possible to have a pause within a 'for loop' before it runs through the next loop? heres the script i've built up so far, i'm running off other variables and arrays to pull in the logos and the animating in is working fine except that they all run in at the same time, basically what i want is that they would run one after the other with a 5 second gap between them..[code]so i did that and put wait(delay); after the var boxcounter=2; in each of the If statements.. but no luck... can anyone shed any light? or suggest a way it get it to hold for a few seconds before running though the loop again? or am i going about this in completely the wrong way??!
View 5 RepliesI am trying to defeat my psychological block with dynamically loaded fonts in AS3, and I have an annoying problem. I am creating a clock with a textfield and I am loading fonts from a SWF library: the available classes/linkages are "Arial", "ArialBold", "MyriadPro", "MyriadProBold" and "Verdana".This is the line where I get the class from the SWF, and it extracts the class correctly
Code:
clock = new Clock( { fontClass: assetsLoader.getFontClass("skin", "Arial") } );
The constructor...
[code]......
I have run across a strange problem. When I load products2.swf by itself, I can call the two "copy" files and everything works. When I open 0342.swf (the index page), I can switch between the home and products2 pages, but I can't view the "copy" pages.I'm guessing there may be some sort of conflict with variable names, but I have been messing with it for most of today.I have uploaded all of the FLA files to here:[url]....
If you make an swf file out of each of the attached items, and open the 0342 file, you will see what is supposed to be happening.
on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = "home";[code].....
I have a button object that I need to scale to align with the variable width of an array of images.However, when I set the width in code, the button does not actually become that width. Tracing out the width gives me the correct value, but on screen.. it's off.
I've proved it to myself by scaling the same button object manually in the properties pane and visually comparing. Both of the buttons below have a width of 410.
Code:
navigatorDown_btn.width = 410;
navigatorDown_btn.x = (stage.stageWidth/2)-(navigatorDown_btn.width/2);
trace(navigatorDown_btn.width); // output: 410
I have published my intro to my website I checked "Loop" and unchecked "Loop" under the Flash section of publishing no matter which I it continues to loop and not go to my website. This is the action I am using:[URL]...
View 1 RepliesI have a variable in a loop that i want to access in a function outside of the loop. However the variable gets deleted when the loop is closed so no longer exists when i call in the function.here is the code; i'm trying to access the variable picHeight from within the scroll function
Code:
pauseTime = 3000;
xmlImages = new XML();
[code].....