Trouble With Path To SetInterval
I have a setInterval running a pause function in a movie that is loaded into a blank MC using this code:
ActionScript Code:
//===============================
//PAUSE FUNCTION
//===============================
function pause(t, v)
{
stall = setInterval(unPause, v, t);
t.stop();
}
function unPause(t)
{
trace("clear & play");
clearInterval(stall);
t.play();
}
//===============================
// INITIATE FUNCTION
//===============================
pause(this,3000);
And I'm trying to clear the "setInterval" from my main _root with a button with this code:
ActionScript Code:
_root.movieLoader.subMovieLoader.clearInterval(stall);
But, it's not working and I have no idea why. Does anyone have any recommendations? I've tried everything!! It's so simple... Why is it not working?
Thanks ahead of time!
ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)
Posted on: 09-05-2003, 01:05 PM
View Complete Forum Thread with Replies
Sponsored Links:
Problem With Path To SetInterval
I have a setInterval running a pause function in a movie that is loaded into a blank MC using this code:
code: //===============================
//PAUSE FUNCTION
//===============================
function pause(t, v)
{
stall = setInterval(unPause, v, t);
t.stop();
}
function unPause(t)
{
trace("clear & play");
clearInterval(stall);
t.play();
}
//===============================
// INITIATE FUNCTION
//===============================
pause(this,3000);
And I'm trying to clear the "setInterval" from my main _root with a button with this code:
code:
_root.movieLoader.subMovieLoader.clearInterval(sta ll);
But, it's not working and I have no idea why. Does anyone have any recommendations? I've tried everything!! It's so simple... Why is it not working?
Thanks ahead of time!
View Replies !
View Related
[CS3] Trouble With SetInterval
little new with AS but I repurposed some code I found to calculate a growing government deficit. It recalcualtes every second but I would like to see the number rise in between seconds. I think setInterval can do this but I have not figured out a way to make it work. My text field is assigned a var of "display_deficit" here is the code.. AS2
Thanks.
PHP Code:
var year = 2009;
var month = 12;
var day = 31;
var data1 = new Date(year, month-1, day); //123109
function countDown () {
data2 = new Date();
difseconds = Math.floor((data1-data2)/1000);
seconds = difseconds;
sectogo = 32693850-difseconds;
deficit = 161312800+((sectogo/32693850)*332269300);
deficit_decimal = Math.round(deficit*1)/1;
display_deficit = formatNumberWithCommas(deficit_decimal);
clearInterval(myInterval);
};
var myInterval = setInterval(countDown, 1000);
function formatNumberWithCommas(num:String):String
{
var ddc:String = num + "";
if (ddc.length < 4)
return ddc;
return formatNumberWithCommas(ddc.slice(0, -3)) + "," + ddc.slice(-3);
}
View Replies !
View Related
Trouble Using The SetInterval Function
I am trying to load in external swf files into a target movie clip randomly after a set period of time, but i am having trouble creating the code following the example from the sctionscript dictionary.
Can anyone help me??!!
I need the code to be in MX
HELP!
View Replies !
View Related
Trouble Wit Random And SetInterval
Hi. I am tring to make an animation which should go like this:
I have a picture and on that picture should appear some squares which should fade in and out. I made a movie clip( a square which fades in and out) and then I tried to duplicate it on the surface of the picture but not in the same time.For this purpose I choosed to use setInterval to duplicate the square asynchrounous.I also wanted the square to appear in a random way and every time I duplicate the movieClip once again first I check the location not to be already 'taken'. But it is not working as I want.I mean that it is not cheking every time if a square appeard or not in that place.I don't understand why.Does setInterval makes somthing wrong ? Would anyone help me? I would be very grateful.
Here is tha code that I used:
var iarray=new Array(new Array(),new Array());
var i;
var j;
for(i=0;i<5;i++)
{
for(j=0;j<11;j++)
iarray[i][j]=false;
}
function addSquare()
{
i=Math.round(Math.random()*4);
j=Math.round(Math.random()*10);
while(iarray[i][j]==true)
{
i=Math.round(Math.random()*4);
j=Math.round(Math.random()*10);
}
duplicateMovieClip(square_mc,"square"+i+j,p++);
_root["square"+i+j]._x=38*j-2;
_root["square"+i+j]._y=38*i-2;
iarray[i][j]=true;
}
p=1;
addSquare();
setInterval(addSquare,50);
View Replies !
View Related
[as] Var Trouble With SetInterval/clearInterval
Baffling, the following. I'll try to relate this as succinctly as possible. Here's my logic:
ActionScript Code:
gTimer5000 = setInterval(sendPostData, 5000);
This invokes my custom sendPostData() every five seconds, which is a POST, then retrieval of data -- successful so far.
sendPostData() only does its thing if global var gReady is true. When true, sendPostData() ...
1) sets gReady to false
2) kills gTimer5000 with clearInterval()
3) does its thing
4) sets gReady to true
5) sets gTimer5000 to setInterval(sendPostData, 5000);
Still, so far, so good.
I also POST and retrieve in reaction to a few buttons, for which I want an immediate response. I have a watcher that watches the properties correlating to these buttons. When a value changes, the watcher callback does this:
ActionScript Code:
gTimer50 = setInterval(sendPostData, 50);
If gReady is true, the POST and retrieval is almost instantaneous. If gReady is false -- because the 5 second interval has invoked it -- this shorter interval keeps trying until the coast is clear. I realized right away that sendPostData() would have to kill both gTimer50 and gTimer5000, so I added that line.
Still, complete success.
If I hit a button while a POST is in progress, sendPostData() completes, then the "queued" event jumps in after 50 milliseconds. When sendPostData() completes the second time, its interval drops back to 5 seconds.
PROBLEM: If I hit a button twice or more while a POST is in progress, the above occurs, but the whole process continues thereafter in 50 millisecond intervals. I checked in the debugger, and oddly, it's gTimer5000 that now cycles at 50 milliseconds.
Any takers? This is wordy, but I hope I made it clear.
View Replies !
View Related
[MX04] Having Trouble With SetInterval Not Clearing
OK, what I an building is a thumbnail gallery for a photo album. When the user goes through the pages, the current page of thumbnails fade out, and the new thumbnails fade in. I do this by using a for loop and calling the fade function listed below. OK, everything works fine EXCEPT when I start clicking through the pages at a fast rate...apparently too many intervals are being created or something is messed up, because it soon goes to crap. If I click at a reasonable rate, like once per second, it runs fine. How can I prevent things going to muck?
Code:
function fadeMovieClip(mClip:MovieClip, nRate:Number):Void{
if(mClip._alpha >= 0 && mClip._alpha <= 100){
var nAlpha:Number = mClip._alpha;
mClip._alpha = nAlpha + nRate;
updateAfterEvent();
}
else {
if(mClip._alpha > 100){
mClip._alpha = 100;
}
else if(mClip._alpha < 0){
mClip._alpha = 0;
}
clearInterval(fIntervalIDs[mClip]);
}
}
in the for loop, I'm doing something like this:
Code:
fIntervalIDs[xpic] = setInterval(fadeMovieClip, 50, xpic, -10);
Where fIntervalIDs is declared as: var fIntervalIDs:Object = new Object();
View Replies !
View Related
Path Trouble
hello, not sure if i can do this, right ill try my best to explain.
i have a main.swf and into this file i load navigation.swf and content.swf, now within content i have a mc named (contentwindow) which is dragable, and within the (contentwindow) mc i have another mc named (content).
now here's the part im stuck on, im tring to add a button to the navigation.swf that tells it to load another swf into contents.swf>contentswindow>content.
can this be done.
thanks in advance
View Replies !
View Related
Target Path Trouble
Hey people...
I was wondering if I could get an assist with this scroll problem I'm having.
I have a dynamic textfield called blog1
an up and a down button that is supposed to scroll the blog 1 textfield when they are rolled over. The buttons are contained in movie clips.
The blog1 textfield and the movie clips that contain my buttons are all in a movie clip called "chooseblog".
"Chooseblog" is in a movieclip called "blue_mc"
On an actions level in chooseblog I load the .txt file that populates blog1 with this command:
this.loadVariables("blog.txt") and I show the text using this command:
blog1 = blogtext.
The file is loading just fine into the textfield but the scroll isnt working.
In order to scroll I'm using:
on (rollOver) {
chooseblahg.blog1.scroll--;
}
and
on (rollOver) {
chooseblahg.blog1.scroll++;
}
I'm pretty sure I just have no idea what I'm doing with the target and reciver paths for this. Can someone please help?
View Replies !
View Related
Target Path Trouble
We have a project here where we need to get a movie to play a certain frame, and it's not happenning. Here's the deal: In the main timeline, lies a movie clip ("argue") that advances frame-by-frame as the user types, revealing new images every keystroke. On certain frames within that movie clip, we want a different movie clip ("boil_mc"), in the main timeline, to gotoAndPlay certain frame labels. We know that we need to use _root.boil_mc but we just can't get any script to actually make this happen. Totally frustrating. Any help here would be greatly appreciated. Thanks.
twiggarts
View Replies !
View Related
Trouble With Calling The Right Path
this is probably really simple but its been bothering me for a while now.
i try to make my code more generic. for example i want to create a function for a preloader which refers to different Movieclips at different times. thats what i am trying to do
//calll my function from somewhere
preload("mcNews.mcImg.mcPlaceholder");
//funciton is located somewhere else
function preload(vmc){
_root[vmc].getTotalBytes();
}
so i simply want to swap the 'vmc' according to the movieclip i need the preloader for. but it seems i can never have a path like "mcNews.mcImg.mcPlaceholder" for my vmc. it only works with something like "mcNews". how come? is there another solution to this
cheers
J
View Replies !
View Related
Path Trouble In Loaded Variables
Im trying to load variables into a mc in a movie, but i cant get them connected. Anyone got any ideas ?
Im loading the variables into level 0, trying to loadMovie them using loadMovie(variablename, "target") in the mc. This does not work.
Also, i want to chech if one specific value of a variable (fps) in level 0 is the value i want it to be. An if statement of a button going:
if (fps == 5) {
_root.framecount.GoToandPlay(20);
}
if (fps == 8) {
_root.framecount.GoToandPlay(25);
}
does not work.
PLZ help, and thanx again.
View Replies !
View Related
SharedObject Path Trouble, Blah
Ok, I am using SharedObject's, which is VERY easy to use, and I've had no problems...
Until I try to give it a specific path other than a global "/"
For instance, this works fine:
Quote:
cookie = SharedObject.getLocal("doghouse");
And this works as well
Quote:
cookie = SharedObject.getLocal("doghouse","/");
But this does not work:
Quote:
cookie = SharedObject.getLocal("doghouse","/projectname");
So if I do not put in a path (the first option above), it puts it deep inside these subfolders depending on where the swf is on my computer.
If I use the universal "/", then it simply places it in a "localhost" folder.
Any ideas on why this isn't working when I specify a subfolder?
Oh, I did try a following "/" after the subfolder name, and it doesn't work as well. So basically, if I specify a subfolder, the .sol file isn't written whatsoever.
Thanks in advance for the help!
View Replies !
View Related
Paths - More Trouble On This Path Than Little Red Riding Hood
Hello there,
I am having a bit of trouble with a site I am making .
Here is what I've done.
a) I've constructed a main page where I have my header and buttons for navigation at the top. At the bottom I have a footer with some basic contact info.
b) In the middle I have various pages load. I have used the following code to load these movies.
//Projects Button - loads the Projects SWF file into the main time line.
function openProjects() {
_root.createEmptyMovieClip("siteContentPage_mc",_r oot.getNextHighestDepth());
_root.siteContentPage_mc.loadMovie("../projects/Projects.swf");
_root.siteContentPage_mc._y=68;
_root.siteContentPage_mc._x=0;
}
Now the problem I am having occurs after this page successfully loads a new set of buttons for a person to select to see various completed projects.
In this movie called Projects.swf, I want to create another empty movie clip, where another page can be displayed beneath the new set of buttons. I am having a tough time figuring out the path to get the movie to load correctly in my browser. I've tried many variations with the code, but it has not proven to be very successful. Here is what I've done:
_root.siteContentPage_mc.createEmptyMovieClip("Loa dedPortfolio_mc",_root.siteContentPage_mc.getNextH ighestDepth());
_root.siteContentPage_mc.LoadedPortfolio_mc.loadMo vie("instructions/Instructions.swf");
_root.siteContentPage_mc.LoadedPortfolio_mc._y=17;
_root.siteContentPage_mc.LoadedPortfolio_mc._x=135
I don't even know if this is on the right wavelength now. Can someone please edit my code, so that I can go to sleep . I posted this earlier, but had difficult understanding what it is that I need to do. If you wouldn't mind, I would also love to have someone explain what it is that they did to fix the code. I know that is asking a lot, but any help is greatly appreciated.
If you would like to see the site it is at www.modainteriordesign.ca
Thanks for your help,
Greg
View Replies !
View Related
Custom Objects And Internal SetInterval Loops -> A Problem Stopping The SetInterval
Let's say I had a class like this:
PHP Code:
var someVar = new Widget();
function Widget() {
// Some variables, etc...
this.int_someCommand = 0;
// Activate the function on instantiation
this.someCommand();
};
Widget.prototype.someCommand = function() {
clearInterval(this.int_someCommand);
this.int_someCommand = setInterval(this, 'someCommandLoop', 50);
};
Widget.prototype.someCommandLoop = function() {
trace("THIS IS A WIDGET LOOP!");
};
...now, I was always under the impression that if you delete an object in Flash, the setInterval loops associated with it would die as well. But when I try to:
PHP Code:
// At some other point in my timeline...
delete someVar;
or:
PHP Code:
someVar = new Object();
...the original loop is still running (I can tell just by reading the trace). How do I go about properly terminating a setInterval loop inside an Object without having to call a clearInterval()? Or is a clearInterval() the only way?
Thanks.
View Replies !
View Related
Tween Class, Does It Use Setinterval? Getting Strange Setinterval Type Problem
I have a gallery with small thumbnails. Upon clicking a thumbnail, I am using the Tween class to pull clips from an array and fade them between each other, loading the clips into a container.
When I click the thumbnail it loads the .swf fine and plays the Tween Class animation just as it's supposed to, however if I click any other thumbnail and go back to that first one the timing gets totally screwed up and the fades get jittery and overlap each other, much like it does with setInterval if you don't clear the intervals.
Is there a way to clear the Tween Class? Does it's timer run on setInterval?
This is the code I am using for the tween class
Thanks!
Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
//content movieclips put into an array
var mcArray:Array = new Array(content1, content2);
for (var k in mcArray) {
mcArray[k]._alpha = 0;
}
// tween class has something called "OnEnterFrameBeacon" and it is added to the stage
// when we import the as file, so I wanted to get rid of it.
var n:Number = 0;
function playFades() {
if (n<mcArray.length) {
var tween_handler1:Object = new Tween(mcArray[n], "_alpha", Strong.easeIn, 0, 100, 1, true);
tween_handler1.onMotionFinished = function() {
//trace("motion finished by "+mcArray[n]);
//n++;
var tween_handler2:Object = new Tween(mcArray[n], "_alpha", Strong.easeIn, 100, 0, 3.5, true);
tween_handler2.onMotionFinished = function() {
//trace("motion finished by "+mcArray[n]);
n++;
playFades();
};
};
} else {
n = 0;
playFades();
}
}
playFades();
View Replies !
View Related
Using Eval Function And Variable In A Path (target Path)
Hello,
I have to reprogram some of my website and it calls to conjugate strings in a way that's beyond my understanding. Please help me with some suggestions. Kind regards.
the original code is:
code:
if (_global.useCount<10) {
//hide
var diff = 10-_global.useCount;
for (diff; diff>0; diff--) {
eval(String(11-diff))._visible = false;
}
}
There are buttons named 1 to 10 and this turns off the ones that are not used. Now I want to nest those buttons in subclip "buttonsRow", instead of having them on main timeline. How do I rewrite that code to make it work with new path?
I have already tried the "associative array" method, but it don't really know how to pack the whole eval function in there. I've tried many combinations, like:
code:
this.buttonRow[eval(String(11-diff))]_visible = false;
//or
this.buttonRow["eval(String(11-diff))"]_visible = false;
//or
buttonRow[eval(String(11-diff))]._visible = false;
//or
buttonRow["eval(String(11-diff))"]._visible = false;
//or
buttonRow[eval(11-diff)]._visible = false;
// or
buttonRow[8]._visible = false;
//the last one at least turns off button 8, lol
Some of those return syntax error and some just don't work. Anyone have any ideas? Thank you again.
View Replies !
View Related
Cannot Export An Avi Of Motion Along A Path When Path Is Specified With Action Script
Hello!
I have the following problem: I am using Flash 8 Professional to produce a series of avi files showing the motion of a dot along different paths. Whenever I use the drawing tools to draw the path everything is all right: I can export both a swf and an avi file showing the motion. The problems start when I use action acript to specify the path: then a swf can be exported, but not an avi file (Flash acts as if it is exporting but the avi file produced shows only a stationary dot). Can anybody help me?
View Replies !
View Related
_root.path="http://www.sitename.com/path/FlashSite/"; Script Issue While Online
Hi there,
I inserted _root.path="http://www.sitename.com/path/FlashSite/"; in the beginning of my action script (2.0). This script accessing contents from an access database, which is working fine, when I tested from my local system folder. But no content from database is displaying while it tested from my localserver (127.0.0.1/path/FlashSite) or from online server.
From a search I found it might be the issue with "Network Access Warning". Is there any other reason? If this is the reason, then how can I resolve it?
For example, how should I replace this -
setTimeout( function(){ _root.content01.content02.gotoAndStop("cont_a");}, 1000 );
Thanks in advance
Shine
View Replies !
View Related
Variable Path Name --> Path=_root
instName="inst1";
path="_root";
Element.prototype.setVisible = function(){
[path+"."+instName]._visible=true;
}
I am trying to build a variable path to an instance. Normally I would do something like this[var]._x, but this doesn't work with _root.
Any ideas?
View Replies !
View Related
_root.path="http://www.sitename.com/path/FlashSite/"; Problem While Online
Hi there,
I inserted _root.path="http://www.sitename.com/path/FlashSite/"; in the beginning of my action script (2.0). This script accessing contents from an access database, which is working fine, when I tested from my local system folder. But no content from database is displaying while it tested from my localserver (127.0.0.1/path/FlashSite) or from online server.
From a search I found it might be the issue with "Network Access Warning". Is there any other reason? If this is the reason, then how can I resolve it?
For example, how should I replace this -
setTimeout( function(){ _root.content01.content02.gotoAndStop("cont_a");}, 1000 );
Thanks in advance
Shine
View Replies !
View Related
Wrong Path Given, What Path To Use?, And Why?
Since the beginning of my Flash time, i never solved the 'giving path' problem in Action Script.
Most of the time my paths work, but sometimes they only work in an empty .fla file and not in my homepage.fla file with the code in another scene.
This time it's the code in the timeline (layer: actions, frame 2, scene: control_panel_sc, .fla file: homepage.fla):
stop();
ccbTime.addItem("tidfme2");
I tried naming the path to:
this.ccbTime.addItem("tidfme2");
super.ccbTime.addItem("tidfme2");
_root.ccbTime.addItem("tidfme2");
_parent.ccbTime.addItem("tidfme2");
_global.ccbTime.addItem("tidfme2");
_level.ccbTime.addItem("tidfme2");
_leven0.ccbTime.addItem("tidfme2");
this._root.ccbTime.addItem("tidfme2");
even adding the scene name to it:
this._root.control_panel_sc.ccbTime.addItem("tidfm e2");
etc. (thus the above paths again + scene name)
All paths above don't work, meaning, i can't see the value in a component ComboBox, though in an empty .fla file i do see this value.
Because you can't help me out without actually seeing the .fla file, i uploaded it:
(every link is the same file, so just choose one URL).
http://pcxpert.dyndns.org/homepage.fla
http://pcxpert.dyndns.org/homepage.zip
http://www.uploading.com/?get=YQ0G1UIC zip version
http://www.uploading.com/?get=VWE6WZKO .fla version
http://members.lycos.nl/johnwhello/homepage.fla
http://members.lycos.nl/johnwhello/homepage.zip
ftp://pcxperting:flash@pcxpert.dyndns.org/homepage.fla
ftp://pcxperting:flash@pcxpert.dyndns.org/homepage.zip
Also, you're authorized to change any file at ftp://pcxperting:flash@pcxpert.dyndns.org (the future pcxperting.com that is made by and made for pcxperts)
View Replies !
View Related
LoadMovie Trouble Trouble Troubles
hello,
i'm having a little bit of trouble here trying to load multiple movies into the same container. not all at one time. like this:
when a button is clicked this happens in my preloader clip which is located in my _root movie:
********************************
// set vars
sectionMovie = _root.currentSection + ".swf";
// un/load movie
unloadMovie("_root.SectionContent");
loadMovie(sectionMovie, "_root.SectionContent");
********************************
then the next frame of the preloader says:
********************************
// get the percent of the movie loaded
bytesLoaded = _root.sectionContent.getBytesLoaded();
bytesTotal = _root.sectionContent.getBytesTotal();
percentLoaded = int((bytesLoaded / bytesTotal)*100);
// if it's loaded then continue
if (percentLoaded == 100) {
this.gotoAndStop (1);
}
********************************
it all seems like it should work. i click "button1" which loads "movie1.swf" perfectly. then i click "button2" and it will unload the movie fine, but it just stops when it gets to "loadMovie"... anyone know what is happening?
thakns in advance for the help, it's a school project...mwaahaha!
xo
View Replies !
View Related
"Oooooh Trouble Trouble..." (Foghat Reference +1000 Points)
I am attempting to add X movie clips to the stage via script, with follow AI behaviors added to each of them. But for now I am just having them immediately start moving left until they hit the stage edge OR eachother...which is the problem.
I cannot get them ALL to stop when they collide with somehting else on the stage...
the way I atempted to solve this problem was to start an array... a list... and to add to that list the name of every object I add to the stage when I add it to the stage. So before ANYTHING moves it loops through this array to see if it is hitting anything else on the stage. Sounds simple right?
Well it seems to only work for the LAST movie attached in my function.
I have attached the script to this post. Please take a look, provide some help, give me some alternative ideas, tell me a good joke :-P, just gimme some feedback. Thanks in advance to anyone who even tries to help.
View Replies !
View Related
AS3 - Path Problem ? Var In Path Problem Not Working
hitrect1_mc.buttonMode = true;
hitrect2_mc.buttonMode = true;
hitrect3_mc.buttonMode = true;
hitrect4_mc.buttonMode = true;
hitrect1_mc.addEventListener(MouseEvent.CLICK , cl1);
hitrect2_mc.addEventListener(MouseEvent.CLICK , cl1);
hitrect3_mc.addEventListener(MouseEvent.CLICK , cl1);
hitrect4_mc.addEventListener(MouseEvent.CLICK , cl1);
function cl1 (e:MouseEvent):void{
xa=e.currentTarget.name.charAt(7);
for (i=1;i<=xa;i++){
targets = "bar"+String(i)+"s_mc";
trace (targets);
soundrect_mc.targets.gotoAndStop(2);
}
well it traces bar1s_mc if it's exact as the code.
if i remove soundrect_mc.targets.gotoAndStop(2); it traces all targets.all 4 of them.How do i make flash recognize "targets" as a path to a movie clip ?
View Replies !
View Related
Trouble Explaining The Trouble
i am having a hard time explaining this problem so i have attached my fla file with some notes attached to it.
i'm trying to customise the a.s. but alas i'm not very good at it yet.
i have an element on the page that when it is clicked on it zooms big and comes to the center of the stage. when you click on it again it zooms back to its original position. - i have this part working.
the problem is i want elements within the zoomed elements to behave the same way. essentially zooming further into the stage. i just can't get it to work.
at this point i am completely lost, any help on this is much appreciated.
thanks everyone
View Replies !
View Related
SetInterval Help
I'm not really sure how to go about using this, I'm terrible with actionscript.
I have a button that needs to have a delayed response, half a second to be specific, and then it needs to bring the user to a different scene. Is that easy to do or no? All I want is the user to click the button, it waits, then goes to a different scene...
Thank you, I'm lost!
View Replies !
View Related
SetInterval()
I am having a small problem with setInterval() -- I can't seem to make it update a var outside the callback?
var arg = 0;
function mySetTest(arg) {
arg++;
trace("arg = " + arg);
}
setInterval(mySetTest, 1000, arg);
tx!
View Replies !
View Related
SetInterval?
I have a slideshow, that loads a jpg and txt file randomly. Now instead of adding a huge number of frames to get time between slides, how do I use the setInterval command to wait, say 10 seconds, before executing the script again?
Thanks
View Replies !
View Related
SetInterval() - BUG
hi,
in the MovieClip:
this.kup=setInterval(function(){ trace("lup") },100);
i attach this movieclip onto stage:
when i removeMovieClip() this movieclip the setInterval function of this movieclip still wokrs..normally when we remove a clip all it's stuff inside it removes. But wht not in this casse with setInterval ?
is it a bug or there is sthg i passed.
View Replies !
View Related
SetInterval
i've read the sticky thread about setInterval and the answer to my questions weren't in there.
question1: is there a way to stop the interval with an action and then start the interval back up again where it left off?
question 2: once an interval is finished, is it possible to start it again?
thanks!
View Replies !
View Related
SetInterval Help
This is a two part question.
first i want to delay the loop on a movie that I have made. So when the movie reaches the end it delays for 2 min. then replays. Someone suggested using setInterval, since I don't know the first thing about actionscript, how it works, syntax anything I am having trouble getting it to work...I don't even know where to start with this.
I am also wondering if I could use this setInterval in the middle of my movie, instead of lengthening a static frame to get a delay.
I assume I would need to have the action call a function (although I am not sure what that really means, it sounds right) to continue playing the movie after the delay....I have seen stuff about using clearInterval so the action does not repeat, How does that work...I wonder if that would apply to my useage of this action?
If somebody wouldn't mine taking sometime and helping me through so I can understand what I need to do and whats going on that would be great. I catch on pretty quick, I just don't have any base as to what action scripting relates to.
Just a note: I have read through the setInterval tutorial in the actionscripting section, twice, over my head...:-(
View Replies !
View Related
SetInterval() Woe...
OK, in doing my own research on setInterval(), I used another board's setInterval() thread to come up with:
Code:
MovieClip.prototype.moveBox = function (){
this._y=this._y+1;
if (this._y = 300){
clearInterval (intID);
}
updateAfterEvent();
}
MovieClip.prototype.moveInterval = function (){
intID= setInterval(this.moveBox, 60,box);
}
intID;
_root.createEmptyMovieClip("box",10)
box.beginFill(0xcc0000,20)
box.moveTo(0,0);
box.lineTo(400,0);
box.lineTo(400,40);
box.lineTo(0,40);
box.lineTo(0,0);
_root.onLoad=function(){
box.moveInterval()
}
A box shows up, but it won't move. The following AS *does* move the box, but for the life 'o me, I can't create/duplicate copies and have them each move.
Code:
_root.createEmptyMovieClip("box",10)
box.beginFill(0xcc0000,20)
box.moveTo(0,0);
box.lineTo(400,0);
box.lineTo(400,40);
box.lineTo(0,40);
box.lineTo(0,0);
_root.onLoad=function(){
intID=setInterval(moveBox,60,box);
}
moveBox=function(clip){
clip._y++;
if(clip._y>300){
clearInterval(intID);
}
updateAfterEvent();
}
The closest I've come is have all the copies stack up on each other but with no movement. I've tried sooo many different variations on the setInterval() theme over the last day and a half - everything from assigning copies of the clip to an array, doing an Object assignment in order to specify a method using function-scope, to the above prototype method, I'm giving up the ghost and CRYING for help! I just wanna create multiple instances of a clip at a given rate, and then move each of them at another rate. So close, but I just couldn't make it happen. Any suggestions would be HUGELY appreciated!
View Replies !
View Related
SetInterval
Hey, I'm using the setInterval to keep calling a function if a variable is blank ... but it messes up when it reaches a certin number (I set a up a var it increment by 1)
here is the main piece code
getBal = setInterval(splitSerbal, 100);
/**** Gets the Balance and Serial Number for the game ****/
function splitSerbal() {
// Makes sure that the balance and serial are parsed once
// Gets the serial and balance seperate
if (serbalreturn == null || serbelreturn == "") {
a++;
trace(a);
getBal = setInterval(splitSerbal, 100);
} else {
do you have any clue why setInterval would mess up
if you want to see for your self make a new file and place that code in it.
thanks
- S
View Replies !
View Related
Should I Use SetInterval?
I have this little bit of script that will create 5 buttons. They all appear at once, but I would like them to appear one right after another. How would I do this? Would I use setInterval? If so, could someone show me how that would work?
Code:
for (h=1; h<=5; h++) {
_root.attachMovie("BtnMC", "Btn"+h, h+1000);
with (eval("Btn"+h)) {
_x = h*20-10;
_y = 240;
}
}
View Replies !
View Related
Using SetInterval
ok. i have the following code in the main timeline:
PHP Code:
MovieClip.prototype.fades = function() {
//continuing code
};
then, in a MC that was loaded using attachMovie, i have this:
PHP Code:
onEnterFrame = function () {
this.fades();
contents.drag.enabled = this.enable;
contents.closer.enabled = this.enable;
};
When trying to replace the onEnterFrame with a setInterval i cannot get the function to work. any ideas?
View Replies !
View Related
SetInterval And Mc's
Hiya
OK .... I must be having a "dumb-day", but I've read all there is to read on setInterval and I'm still having trouble.
I have a clip on the main timeline that I want to play every 10 seconds. I placed the following code on the last frame of the clip :
stop();
setInterval( function() {gotoAndPlay(1);}, 10000);
Works great for about 5 minutes and then starts to glitch. Anyone know what I am doing wrong?
Thanks in advance
Mick
View Replies !
View Related
SetInterval
Why doesn't this work?
Code:
function swfWait5() {
loadMovie("finalnews.swf", "_root.mc");
clearInterval(SW6);
}
SW6 = setInterval(swfWait2, 2000);
View Replies !
View Related
SetInterval With Xml. . . Is This Possible?
I need a little assistance in creating a setInterval function based on my xml file. If anyone could help, I would really appreciate it!
Here's a sample of xml file:
<count id="1">
<mediatype>1</mediatype>
<information>Introduction</information>
<endtime>12</endtime>
</count>
<count id="2">
<mediatype>2</mediatype>
<information>Clip 2</information>
<endtime>50</endtime>
</count>
<count id="3">
<mediatype>3</mediatype>
<information>Clip 3</information>
<endtime>150</endtime>
</count>
This is a sample of my actionscript:
Code:
myInterval = setInterval(beginFadeOut, time());
function beginFadeOut() {
clearInterval(myInterval);
mc.fadeIn(100, 7);
}
function time() {
sec = ((10/5)*1000);
trace("seconds called");
return sec;
}
eg.
sec = parent.childNodes[i].firstChild;
So, the value would be put in an array. I have tried several things, and have tried to ask the form, but no response.
If I need to post the .fla just let me know. Any assistance would be great!
Thanks,
cbs
View Replies !
View Related
SetInterval
Hi,
basically I'm trying to create a grid of thumbnails.
I'm using to functions:
function 1. loops through an array of pictures and finds the necessary params for it(ie xpos, ypos, ect...)
function 2. creates that thumbnail.
--------------
What I want to do is have them appear one by one not at the same time, but I don't want a timeline loop, so here's what I got up to now
--------------
/*create the clip to hold the grid on level1*/
_root.createEmptyMovieClip("grid", 1);
_root[grid]._x = 20;
_root[grid]._y = 100;
/*initializing my vars to create grid*/
rows = 5;
cols = 7;
xpos = 0;
ypos = 0;
/*this is the function I want to call every 2 seconds*/
function createThumb(item, type, xpos, ypos, targ) {
trace("xpos:"+xpos+" ypos:"+ypos);
}
/*here I loop through my Array of pics and call the above function*/
for (i=1; i<=pAr.length; i++) {
(i%cols == 0) ? xpos=(cols-1)*100 : xpos=((i%cols)-1)*100;
(i%cols == 1 && i != 1) ? ypos=ypos+72 : ypos=ypos;
interv = setInterval(createThumb, 1000, "test", "test", xpos, ypos, "test");
/*clearInterval(interv);*/
}
---------------
Notice my commented clearIntervals, I though this would work but it's clears the interval before calling the function.
Any Help to figure this out would be muchly appreciated.
Thanks
Dan
View Replies !
View Related
SetInterval Bug?
Hey,
I've got some weird problems when using setInterval. Look at the folowing two codes and try them:
code:
//--Works as it should be---
var test = "Test failed";
var nr = 1;
var text1 = "Test completed";
function newMap() {
test = this["text"+nr];
trace(test);
}
newMap();
code:
//--Does't work, 'test' totaly looses it's value---
var test = "Test failed";
var nr = 1;
var text1 = "Test completed";
function newMap() {
test = this["text"+nr];
trace(test);
clearInterval(itv);
}
itv = setInterval(newMap, 120);
What causes this? What can I do to fix it?
Thnx a lot,
SaphuA
View Replies !
View Related
SetInterval Help
See if I can describe whats happening here. Im getting some strange results.
I have used setInterval before with no problems whatsoever, untill now.
I have my main movie that loads external swf's into an emptyclip.
In one of those external swf's I have another emptyclip that loads other external swf's. In those swf's are MC's that have pictures in them that scroll from left to right. When the picture gets in the middle is where I use this setInterval script.
code:
stop();
function stopClip() {
clearInterval(interval);
play();
}
interval = setInterval(stopClip, 400)
When I try to load another swf with other pics, it all goes to wack. The picture MC's duplicate and I get pictures flying everywhere.
If I take out the setInterval script, it play fine, but I need it to stop for 3 seconds. Any other way to get the MC to stop for 3 seconds?
View Replies !
View Related
SetInterval
This is a great function to use. However, I had some inconsistancies with timing. Should I set the intervel to a multiple of the framerate for best result? I was pubishing at 12 frames per second and using an interval time of 83 miliseconds
bjornolafson@hotmail.com
bjornolafson@hotmail.com
View Replies !
View Related
Use Of SetInterval().
I need to have a function that reads a text file or database every 30 seconds say.
The system I am developing needs to be running indefinitely - i.e. 10 hours+ at a time.
Is it OK for me to use the function setInterval()?
I'm just worried that inadvertantly I might chew up processor resources?
The reason why I'm concerned is because there also exists clearInterval(). I just thought there must be a good reason to have this other function.
Should I be doing what I want to do using another method?
Any feedback/help would be appreciated.
Thanks.
OM
View Replies !
View Related
Where It's At? (setInterval)
I wrote this code
ActionScript:
_root.izmjena = setInterval(promjena, 2000);
function promjena() {
trace(this);
trace(_parent);
}
but when i traced to locate where is this setInterval it says "undefined".
so where it's at?
Problem is when i try to access some MC from this function called in setInterval, it doesn't work although that same MC is in root. So where is that setInterval located?
View Replies !
View Related
SetInterval....please Help
Okay i've read through almost all posts on setIntervals and still can't work out how to do what i need.
I have a main menu of 4 buttons that access a content movieclip with all my content in. One of these have a music page that has images changing within a movie clip every 25 seconds using setIntervals. These images are to run constantly until the user choses another menu option this is working fine. I then want to clearInterval(timer) once a new choice is made. Currently the timer just keeps running and resets the site.
I understand what needs to be done but don't know how to access the setInterval code i have within 2 movieclips. as far as i can see i need to clear the setInterval via the menu buttons.....and *u** knows how.
I usually have patience to work these bits out but, im a wee short of time on this one and have to get this finished.
I've tried to attach my fla but its to big for forum even after compression (4.2mb). if anyone can help will mail the file.
Thanks a bundle for any help, my sanity is thread bare....not helped by too much coffee due to desperation, so thanks
View Replies !
View Related
Setinterval, But How?
i got a simple movie using property. but i dont know how to use the setinterval action to only take speed influence on the movement of mc vozi
thats the main script:
startx = GetProperty(/:vozi,_x) ;
starty = GetProperty(/:vozi,_y) ;
horizontalno = /:targetx-startx;
vertikalno = /:targety-starty;
setProperty(/:vozi, _x, startx+(horizontalno/2));
setProperty(/:vozi, _y, starty+(vertikalno/2));
thtas on the buttons:
on (release) {
targetx = 195;
targety = 139;
}
thanks for any help...
setinterval but how?
View Replies !
View Related
SetInterval
I need to have an animation play every 30 seconds(example). I tried this but it did not work. The animation started playing but then it kept on playing.
Code:
setInterval(function () {
ball.gotoAndPlay(1);
}, 30000);
Where did I go wrong?
Thanks
View Replies !
View Related
|