ActionScript 2.0 :: MC's Overwriting Themselves When It Goes Back To The Top Of The For Loop
Jun 26, 2007
I have a for loop that attaches a new mc to the stage fills it with info from a database. I should be left with three mc's but not the case. only the last one shows up on the stage. I went thru it with the debugger and it is filling all those movieClips with data but, overwrites them when it goes back to the top of the for loop.
I wrote over my actionscript code, saved it and closed it. now i cant get the information back. Do you have any tips. Been writing for 2 weeks on it. Iknoow i should backup it :)
what do you do when a loop "overwrites" itself and only displays the last value?
Code: for ( var j:Number = 0; j < xml_array.length; j++ ) { //Set state movie clips' parentMC and mainBroadcaster and onRelease functions this ["state" + j + "_mc"].mainBroadcaster = this.mainBroadcaster;
[code]....
here is the code snippet for the loop; I've used this before in a previous project and it didn't have this problem.
We are developing a video chatting application on flex, it works well on Desktop systems and while running on a laptop the sound is loop backed and becomming a large noise, Please help me to fix the problem.
How do you make a loop go back and start at 0 again? var mySWF:Array; var currentSWF:Number = 0; var myXML:XML = new XML(); myXML.ignoreWhite = true; myXML.load("myXML.xml"); [Code] .....
I'm trying to make my movie loop, but when I enter the following code in the last movie clip (layer) of my swf movie, it only loops back to the first frame of that movie clip (layer).
gotoAnd Play (1);
When I do the code above it doesn't loop back to the beginning of my movie.
What is the proper code for making it loop to the very beginning?
I tried to do the following code, but I got an error message. I'm not sure of the proper syntax for the code.
tli_logo.gotoAndPlay(1);
tli_logo is the name of the very first movie clip (layer) of the swf movie.
I believe that making the last frame of the last movie clip (layer) loop back to the first frame of the first movie clip (layer) will be what I am trying to achieve. Is this the proper way to go about this, or there a better and more proper way to do this. If there is, then please send me the proper syntax AS cs3 code to do it.
I know that I can send a string back to AS2 and read it but I'm not sure how to work with arrays, do I have to save everything to an array and pass the array to AS2 and then have a function in AS2 to output all the elements of the array to the dynamic text box?
I have used the flash accessibility tab to add index numbers to 19 elements on my page.However, once I reach tab number 19 I cant get it to loop back to tab index number 1.
I'm trying to animate some leaves that rotate back and forth to simulate leaves blowing in the wind. I got to animate the leaves one way, but i couldn't figure out how to make it loop (go back and forth).Here's the code: on the movie clip named "leaf" witht the following code attached to it:
I'm trying to make a button that when clicked will make my movie clip go to the next frame, and it works fine only when it gets to the last frame in the movie clip it just stops. How can I make it loop back to the first frame with the same button. I know I can have next/previous buttons but I'm using only one button and need it to change frames on a loop.
Code: stop(); circleBtn.addEventListener(MouseEvent.CLICK, onNext); function onNext(evt:MouseEvent){ circle.nextFrame(); }
I've got an interesting issue with the actionscript in my file. I've created a slide show with 27 labeled frames - they've been labeled "frame 1", "frame 2", "frame 3", etc... My issue is the first time everything works perfectly, if you hit next or previous. It goes to the correct frame. On the last frame if you click next it should take you back to "frame 1" and basically loop through all the frames again if you keep pressing next. The problem is it goes back to frame 1, and then next doesn't work on this frame. I don't understand what's going on considering the first time around - these frames work perfectly.Here's the code on frame 1:
I am putting together a small slideshow of pictures and it's only about 350 frames. I haven't worked with Flash since version 4.0, so I'm still trying to figure out Adobe's setup. 4.0's setup was so easy when it came to replaying a video once it hit the last keyframe, but I'm so lost in this ActionScript stuff.
How do I get the video to loop back and start playing again automatically?
I've got an interesting issue with the actionscript in my file. I've created a slide show with 27 labeled frames - they've been labeled "frame 1", "frame 2", "frame 3", etc... My issue is the first time everything works perfectly, if you hit next or previous. It goes to the correct frame. On the last frame if you click next it should take you back to "frame 1" and basically loop through all the frames again if you keep pressing next. The problem is it goes back to frame 1, and then next doesn't work on this frame. I don't understand what's going on considering the first time around - these frames work perfectly.
I'm trying to loop back to the first frame of a movie clip using buttons. The movie clip is on a single frame on the main timeline. The buttons control the animation within the movie clip. The movie clip has three frames, and when I get to the last frame, I don't know how to write the code to go back to frame one, on the forth press of the next button. The code I'm using is below:
At the end of my SWF video (FLV + XML for closed captions), I want to go back to the beginning of the video, but not replay it...so that when users have finished watching it they have the title page to look at instead of a big black box.
I've got an intro for a movie,and a single button appears around frame 58,and I've tried giving it a function so it will skip to fram 478 and play the whole movie from there on:
but it keeps saying "statement must appear within handler" and I've got the same problem when the movie reaches frame 477 I want it to go back to frame 58 and play from there so it would loop all until the button is clicked:
I want to overwrite a XML file on my localhost, I always geta error "Error #1088: "The markup in the document following theroot element must be well-formed."AS3:
function upload():void { trace("upload"); str1 = "<?xml version='1.0'
I've created two custom classes to contain data for a web forum controller flash tool:
class postClass { public var post_id:Number; //plus some other variables like timestamp etc
[code]....
When I try to assign a new post to a user (by adding the post data to the postArray variable) I overwrite posts that I had already placed under other users. More specifically, if I'm posting the first post for User Y, I overwrite the first post for User X with the exact same data.I thought this was a reference vs. value passing error, but I tried to eliminate this by not copying the "postClass" objects, but assigning the data directly into the user's postArray array:
var userArray:Array = new Array(); function addNewUser(masterPostIndex,UserNumber) {
[code]....
This all seems to work fine until I try to write a new post for a second or third user. If I trace the contents of User X's posts, they immediately become identical to the content of User Y's posts, as soon as User Y's posts are added. Later, when User Z comes along, both User X and User Y's posts are overwritten. This code is kinda long, so I didn't want to post the whole thing - but I can post any parts you're interested in, of course.
This really 'feels' like a reference-passing error (arrays are all looking at the same location in memory), but I can't figure out what I'm doing wrong - I'm not making a postClass object and then pushing it onto the user's postArray (I tried that too, same result).
var newPost:postClass = new postClass(); //read and assign values to newPost userArray[userIndex].push(newPost); //
this is clearly passing the referenceI can see how the latter example would pass the reference to newPost to the user object, then when I change newPost in the next iteration (when user Y posts something), User X's data will change too. I tried to avoid this with the first set of code.
When I make changes to a Flex project and rerun the project, it seems that FlashBuilder4 rewrites my html wrapper that embeds the SWF. But I have additional javascript code in the html wrapper and don't want to keep losing my code. I had to re-write the code once and it was a pain in the neck.How do I stop it from re-writing the html. And the related question: how do I stop it from deleting the html during a clean?I basically need to exclude the html from its processing once it's been created the first time. P.S. I'm using Flash Builder 4, but I suppose it's the same in Flex Builder 3.
I have a movie clip called "play_btn". The timeline has 2 labels, "paused" & "playing" ... paused contains a movie clip called "playButton" and playing contains a movie clip called "pauseButton". playButton & pauseButton contain images of a pause button and a play button.I am trying to replace the playButton image using:
loadMovie("play.png", play_btn.playButton);
This works when the swf is first loaded but then if I do:
I've been saving plain text files to the hard drive using FileReference.save and everything is working fine. However, instead of overwriting a file with the same name (as the dialogue box says it is going to), the new text is simply added to the end of the text file! I've even tried using a Byte array, but the same thing happens. Perhaps a Mac OS Flash Player bug?