ActionScript 2.0 :: Setting Interval, Not Working Externally
Feb 16, 2005
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 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?
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 successfully loaded XML data into a SWF file and am able to get values from the XML without much problem. The code works. For example my test productimage[1].toString(); is returning back the correct value from the XML file.My issue is when I load this SWF into another, a preloader, the code no longer works? The preloader is working fine and the rest of the SWF file is loaded in succesffully, even the XML data appears to be working when I run a trace i.e. trace(e.target.data.toString()), but for some reason the individual data values such as productimage are no longer being defined??]code]
I have successfully loaded XML data into a SWF file and am able to get values from the XML without much problem. The code works. For example my test productimage[1].toString(); is returning back the correct value from the XML file.My issue is when I load this SWF into another, a preloader, the code no longer works? The preloader is working fine and the rest of the SWF file is loaded in succesffully, even the XML data appears to be working when I run a trace i.e. trace(e.target.data.toString()), but for some reason the individual data values such as productimage are no longer being defined???
Code: var requestXML:URLRequest = new URLRequest("liveshow.xml"); var loader:URLLoader = new URLLoader();
i have a swf file which is a framework file done in puremvc and i m loading multiple swf files. one of the swf file loaded into the main swf file loads multiple sub swf files in it. works fine but in the loaded swf file which loads multiple swf files in it.. button dosent work at all. i m not able to click on any button. i m jst making a tree structure so can be easily understood..
container swf -> external swf -> miniSwf file and in miniSwf dynamic button are not clickable but they have all the Mouse eventListeners.
I have a VBox that I am populating programatically, After a particular event (dragDrop) I do some calculations, reorder some variables, then re-build the VBox. This all works great, but I want the VBox to scroll back to the correct verticalScrollPosition. I tried even the simplest thing: myVBox.verticalScrollPosition = 200But I just can't get it to set the scroll position after it's rebuilt.
Edit: per Franky's response I realized that my dragDrop function was calling the rebuilder function then the position setter function back to back, which means it wasn't done being built when it was trying to set. Now I'm passing the position I want the box set to to the rebuilder function which sets the scroll position at the end of building the VBox and everything works out great.
I'm absolutely and completely dumbfounded by this problem...
Code: target.txtField.onSetFocus = function() { trace(inputText.getFieldText()); // custom function, outputs a string (ex. "name") if (this.text == inputText.getFieldText()) { this IF statement runs through fine this.text = ""; // won't work, no matter if I set it to empy or anything... } }
I'm probably doing something very stupid here... but I can't figure out what. I've done my research, gone over examples online and in books, still not working. The text field goes blank, but I cannot type into it, and it loses focus (if I try using Selection.setFocus(this); it doesn't work).
I'm pulling in a xml-file with just one result in it. One of the nodes is picture, which contains a link to a picture. This is the xml-file:
<artist> <id>502</id> <name>Bad Religion</name>
[Code]....
I've tested the url, and it's correct. This is how I try to bind the url to the image instance (artistPic), but it's not working. Displaying the artist name does work.
var artist:XMLList = new XMLList(event.result); artistPic.source = artist.picture; lblArtistName.text = artist.name;
I'm trying to build a little tile editor for a game I'm about to make, but in setting up the tiles on the screen something goes wrong. Here's the code:
[Code]...
the trace just spits a whole bunch of 'undefined's at me. I double checked the variables once again just to be sure, and they're all right.
I'm setting up a page that uses a flash menu to load html pages into a div container by the following call:
on (release){ getURL("javascript:getPage('test.html')"); }
The loading works fine, but some of my pages had specific jquery scripts and that's where I've struck out so far. I assumed all I needed to do was transfer the script importations, css stylesheets and the jquery functions to my main document, but it won't work.
I also tried importing the html as a the complete html, which works on it's own, but not when imported into the main document. Most recently I heard I should try shifting the jquery function calls to the end of the loaded document, to after the content, My scripts work, just not when imported, so I suppose my question is how can I make the main- and imported documents play nice with each other? What say you we make this a jump-start tutorial for all us noobs to reference?
it looks like the problem is that the interval has not been clear so every time i click away from my slide show (for example navigate to my contact swf) and then come back to the slide show the pictures keep looping on top of each other and fading at the wrong times too.
var id, current; var k = 0, p = 0; var slide = 1; function loadXML(loaded) {
I 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!
I am trying to create a Flash file that will export a JPEG file for a certain number of files, using Quasimondo's BitmapExporter class.
I can get it to successfully export 1 image, but I have a problem getting it to export an image for each element in the loop.
I need to pause the script (with an interval perhaps?) to allow the export to finish, then continue and do the same for every element in the loop. (in this case 5 times).
Code: import flash.display.BitmapData; import com.quasimondo.display.BitmapExporter; // This is the bitmap that will be drawn
trying to count key presses in a 30 sec interval. if the number of keypresses is above say 20 in 30 secs they go to a new frame, otherwise they go back to the start and the count begins again. using as2 and flash cs4. very confused.... not sure if onEnterFrame is better than keyListener.
I am working on an eLearning course whereas client requied the course to be keyboard accessible. He wants all the shortcuts with Alt key combination.I can trap the Alt key with the use of enterframe but that makes my course processing heavy so I tried to trap Alt key with keylistener event but unfortunately keylistener event doesn't listen Alt key .how to trap Alt key without using enterframe or interval?
This is literally a little script that I have found on the Internet:
this.stop(); //zodat de stage op frame 1 blijft var timer:Timer = new Timer(3000,1);//een timer aanmaken die 1x afgaat na 30 seconden timer.addEventListener(TimerEvent.TIMER, timerHandler); //luisteren wanneer de timer afgaat timer.start(); //de timer starten
I have a logo which animates one time and stops. What I would like is, it should loop every 5 seconds interval. The following is the action scipt 3 written in the flash document.
Just wondering how to make my interval start when I want it to because im trying to delay a function but i only want that interval to work when the code is being executed so i would have to add some kind of 'start delay' code inside the function.
I am using set interval. I can clear the interval to stop it, but when I use the play(); command it continues from the beginning and I want it to continue from where I left off. The timeline is 10 frame long. I want to continue from a specific frame. I already tried gotoAndPlay (frame#) and it doesn't work. Maybe I had it in the wrong place. I bolded the area that needs some sort of code, somewhere within/below it.
Here is the code. frame #1 //SET INTERVAL stop(); callback1 = function (){ if(_currentframe == 10){ gotoAndPlay(1); clearInterval(ID); [Code] .....