SetInterval Won't Work
I can't get setInterval to work in this menu system I am creating. The function will execute immediately and not delay like I want it to. Can you tell me what's up.
ActionScript Code: stop();import mx.transitions.Tween;import mx.transitions.easing.*;/////////////////////////Button Functions/////////////////////////function menuclose(item, beg, end) { var butclose:Tween = new Tween(item, "_y", Strong.easeOut, beg, end, .3, true); var maskclose:Tween = new Tween(eval(item+"mask"), "_y", Strong.easeOut, beg, -225, .3, true);};function menuopen(item, beg, end) { var butopen:Tween = new Tween(item, "_y", Strong.easeOut, beg, end, .3, true); var maskopen:Tween = new Tween(eval(item+"mask"), "_y", Strong.easeOut, beg, end, .3, true);};function butup() { var butin:Tween = new Tween(b1, "_alpha", Strong.easeOut, 0, 12, .5, true);};function butdown() { var butin:Tween = new Tween(b1, "_alpha", Strong.easeOut, 12, 0, .5, true);};///////////////////////Button Actions///////////////////////b1.onRollOver = function() { butup(b1); menuopen(d1, -219, -69);};b1.onRollOut = function() { butdown(); dropup = setInterval(menuclose(d1, -69, -219), 500);};
KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 10-31-2006, 01:36 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Why SetInterval Won't Work?
I just want to build a menu that will fade out gradually when mouse roll out, but I tried so many ways and got no result. And finally I decided to use setInterval to control the alpha of the menu, but it still won't work! Anyone could help me with the following script? And easier way to do a fading out menu is also welcomed, thank you!!
-------------------------------------
startslide = false;
menuhide = false;
stop();
function menuhide() {
//the menu background slide away
while (_root.button_black._x>50) {
_root.button_black._x -= 10;
}
//the menu fade out gradually
while (_root.menu._alpha>0) {
_root.menu._alpha -= 10;
}
trace(_root.button_black._x);
}
_root.onEnterFrame = function() {
if (_root._xmouse>250) {
//when mouse roll out from the menu, menu begins to fade out
startslide = true;
}
if (startslide) {
setInterval(menuhide, 300);
//setInterval won't work (
}
};
SetInterval Won't Work
Hi all
I have the following AS for a title sequence.
code:
this.finalX = 330;
{
this._alpha = 0
this.onEnterFrame = function ()
{
if (this._alpha < 100)
{
this._alpha += 3;
}
};
};
slipery.onEnterFrame = function ()
{
this._x += 3;
if (this._x > finalX)
{
this._x = finalX;
ertigo.onEnterFrame = function (){
this._alpha +=3;
if (this._alpha < 100)
{
this._alpha +100;
}
};
};
};
Everything works fine except that I want to insert a setInterval into the script so that it pauses for x seconds after:
code: this.finalX = 330;
{
this._alpha = 0
this.onEnterFrame = function ()
{
if (this._alpha < 100)
{
this._alpha += 3;
}
};
};
Have looked up reference books and tutorials but can't seem to get setInterval to work. When I do insert something like: code: setInterval (Slipery,5000) it just negates the first fade in effect.
Any clues what I'm doing wrong?
I Cant Get SetInterval To Work :(
Hi all, im having problems with setInterval. it does not work for me.
I have a button that changes frames and that calls a global function that
formats the content on the page. Problem is i need to delay it a bit because the code that gets the page size is currently getting the PREVIOUS pages metrics. So a delay of about 1/2 a second should provide enough time to load the new frame and then run the format code.
However this code does not work:
The next button:
ActionScript Code:
cnt.nextFrame();
tID = setInterval(format(),250);
then in the format function I have
ActionScript Code:
clearInterval(tID);
//rest of my code to format
I tested it with a 10 second delay, and made an output text box say "page turning" when i turn the page, then in the format function it adds on to that text box "formatted"; However its running immediately, as soon as i click the page i get "page turning formatted" instead of formatted being shot there 10 seconds after.
Am i writing the setInterval function wrong? I read about it in help and it appears there are 3 variations of how you can write it, but the other ones seem to be for methods of objects, whereas i am just calling a global function on the _root timeline!
Anyways, any help would be appreciated. Or maybe an example of a working setInterval function!
Thanks
MCM
Second SetInterval Won't Work
Hi All,
I have a movie clip containing two setIntervals on its timeline, but the second setInterval won't work. I've uploaded the .fla if someone wouldn't mind taking a look? The movie clip is on the layer called text5.
Would really appreciate any advice.
Thanks
As2 Oop - Can't Get SetInterval To Work
hello all, i am stuck here
i am trying to trigger a function after a certain delay, which is why i used setInterval.
i can get the function to happen after a certain time, but clearInterval doesnt seem to work
it always worked before, when i was not writing it in oop, is there something special with this function when it's used in oop?
in the Delay.as file:
Code:
class Delay extends MovieClip {
//
///////////////
// variables //
///////////////
//
var delay:Number;
private var countdown:Number;
//
/////////////////
// constructor //
/////////////////
//
function Delay () {
}
//
///////////////////////////
// functions definitions //
///////////////////////////
//
function init (x:Number, y:Number) {
this._x = x;
this._y = y;
}
function onRelease () {
traceStuff ();
}
//
function traceStuff () {
this.countdown = setInterval (delayedtraceStuff, 2500);
}
function delayedtraceStuff () {
this.delay--;
if (delay <= 0) {
trace ("stuff");
clearInterval (this.countdown);
}
}
//
}
on test_delay.fla stage:
Code:
this.attachMovie ("square_inLib", "square", this.getNextHighestDepth ()).init (64, 64);
quite appreciated if someone could explain what im doing wrong
see attached files if need be.
Does SetInterval Actually Work?
Ok ive taken my previous post and am just focusing on the setInterval
Why does this example not work???
var numberOfTimes:Number = 0;
var checkInterval:Number = 0;
this.clearInterval(checkInterval);
this.checkInterval = setInterval(watchMyInterval, 100);
function watchMyInterval()
{ trace(numberOfTimes); if (numberOfTimes == 5)
{ this.clearInterval(checkInterval);
trace("this.clearInterval(checkInterval);");
}
numberOfTimes++;
}
Getting Setinterval To Work
Hi
I am trying to load a the same movieclip on to the stage every 5 secs. I am having problems with setinterval as it doesn't seem to work.
please can u help here is the code
//this function will get a loop of the number of daisys
getdaisys = function(){
i = 1 ;
//geting a the movieclip
//setInterval(duplicateMovieClip(test, "daisy"+i+"_mc", i), 5000);
_root.attachMovie("mc_daisy_ani", "daisy_mc"+i, i)
this._x+=(Math.random()*4)-2 ;
this._y+=(Math.random()*4)-2;
this.gotoAndPlay;
}
//call the function
for(i=1; i <= 5; i++){
setInterval(getdaisys(),5000);
};
SetInterval Won't Work With 'Next' Button
I've made a slideshow which will change pictures every 15 seconds, but I also want the option of being able to click a 'next' button if the user doesn't want to wait 15 seconds and display the next picture themselves, and then the timer should start from 15 seconds again. The timer works fine, until the next button is used, this is whats on the button:
Code:
on (release) {
nextFrame();
}
When the next button is used the timer messes up, it's no longer 15 seconds, sometimes its 8secs, sometimes its 1sec! I have no idea why this happening. Here is the code for the timer:
Code:
var intID = setInterval(function () {
_root.nextFrame();
clearInterval(intID);
}, 15000);
I have put that in every frame of the movie, I figured by using the clearInterval on every frame, when the next frame played it would start a new setInterval of 15seconds, but this is not the case.
I'd appreciate any help.
Thanks.
Setinterval Doesn't Work
To test setinterval I've got 4 frames with a simple 1 to 4 drawn into it. It is supposed to go from 1 to 4 every second and then go back to 1 again.
In frame 1 I'v got this code:
Code:
stop();
setInterval(function () {
nextFrame();
}, 1000);
On the last frame I've got this code so that it goes back to 1 and the process repeats itself:
Code:
clearInterval()
gotoAndPlay(1);
But it doesn't work: flash gets confused with the timing. The first 2 seconds it goes: 1 2 3 4 1 2 3 4, but then it gets out of sync and starts skipping frames: 1 3 4 1 3 4 1 1 and other combinations.
What is causing this?
SetInterval In Loaded Swf Does Not Work
Hi folks, I am loading a *.swf into an mc instance via loadMovie().
main movie:
ActionScript Code:
function openMovie(whichmc) {
loadMovie("myMovie.swf", _root.contentbox1);}
I use a setInterval function in some button script in "myMovie.swf" that does not work when loaded into the _root.contentbox1. (thanks CyanBlue for the diagnosis )
external swf:
ActionScript Code:
this.topbutton.onRelease = function() {
clearInterval(scroller);
quickie();}
function quickie() {
scroller = setInterval(moveHome, 5);
}
Any obvious reasons why?
Thanks,
Cheez
*link to original thread http://www.actionscripts.org/forums/...threadid=22307
SetInterval ClearInterval Does Not Work
My clearInterval is not working. I have a nested for loop that calls out a setInterval to display tiles of an image at random times. The animation works but the clearInterval is never fired so i get an infinite loop. Any ideas on how to target the variable intervalId in the code to clear it? Thanks,
Attach Code
import flash.display.BitmapData;
import flash.geom.Matrix;
//padding
var pad:Number = 0;
var blockSize:Number = 10;
var m:Matrix = new Matrix();
var dep:Number = 30;
var intervalId:Number;
// # of squares to run
var maxCount:Number = 304;
var count:Number =0;
var duration:Number = 200;
function executeCallback(clip:MovieClip):Void {
trace("executeCallback intervalId: " + intervalId + " count: " + count);
clip._alpha = 100;
if (count >= maxCount) {
clearInterval(intervalId);
trace("cleared interval ");
}
count ++;
}
for (var i = 0; i<box._height/blockSize; i++) {
for (var j = 0; j<=box._width/blockSize; j++) {
bmp = new BitmapData(blockSize, blockSize, true, 0x00CCCCCC);
mc = _root.createEmptyMovieClip("mc_"+j+"_"+i, dep++);
m.tx = -j*blockSize;
m.ty = -i*blockSize;
bmp.draw(box,m);
mc.attachBitmap(bmp,dep++);
mc._x = j*(blockSize+pad);
mc._y = i*(blockSize+pad);
mc._x += box._x;
mc._y += box._y+box._height+pad;
mc._alpha = 0;
duration = Math.random()*2000;
intervalId = setInterval(this, "executeCallback", duration, mc);
}
}
stop();
SetInterval ClearInterval Does Not Work
My clearInterval is not working. I have a nested for loop that calls out a setInterval to display tiles of an image at random times. The animation works but the clearInterval is never fired so i get an infinite loop. Any ideas on how to target the variable intervalId in the code to clear it? Thanks,
Attach Code
import flash.display.BitmapData;
import flash.geom.Matrix;
//padding
var pad:Number = 0;
var blockSize:Number = 10;
var m:Matrix = new Matrix();
var dep:Number = 30;
var intervalId:Number;
// # of squares to run
var maxCount:Number = 304;
var count:Number =0;
var duration:Number = 200;
function executeCallback(clip:MovieClip):Void {
trace("executeCallback intervalId: " + intervalId + " count: " + count);
clip._alpha = 100;
if (count >= maxCount) {
clearInterval(intervalId);
trace("cleared interval ");
}
count ++;
}
for (var i = 0; i<box._height/blockSize; i++) {
for (var j = 0; j<=box._width/blockSize; j++) {
bmp = new BitmapData(blockSize, blockSize, true, 0x00CCCCCC);
mc = _root.createEmptyMovieClip("mc_"+j+"_"+i, dep++);
m.tx = -j*blockSize;
m.ty = -i*blockSize;
bmp.draw(box,m);
mc.attachBitmap(bmp,dep++);
mc._x = j*(blockSize+pad);
mc._y = i*(blockSize+pad);
mc._x += box._x;
mc._y += box._y+box._height+pad;
mc._alpha = 0;
duration = Math.random()*2000;
intervalId = setInterval(this, "executeCallback", duration, mc);
}
}
stop();
Why Does This Not Work? SetInterval Prob
Hello all,
PHP Code:
var myInterval = setInterval(playText, 6000);
var p:Number = 0;
pause_btn.addEventListener(MouseEvent.MOUSE_UP,
function(evt:MouseEvent) {
if(p==0){
clearInterval(myInterval);
p++;
trace('puase p='+p);
}else{
setInterval(playText, 6000);
p--;
trace('running p='+p);
}
}
);
for some reason this code traces properly but only works the first time I pause and then resume - but after that it wont pause again??
What is wrong with this??
Thanks
Help Getting Timer Based On SetInterval To Work
I'm building out the basic code for a timer that does 2 things:
Counts down "bonus points" -- 10th of the total milliseconds in the timer
Count down seconds and tenths of seconds
The bonus points will tick down along with the time -- this is part of a larger quiz interactive project that I'm putting together.
I can't quite figure out the following (my math is bad, I think):
Why can't the setInterval fire off in 1 millisecond increments? Is it too fast for the Flash Player to handle?
What's wrong with my math for the milliseconds on the time? I'd like to ONLY show 10ths of a second instead of thousandths.
The file is attached. Feel free to use it for whatever, if you like. I just need some input on the issues above.
Thanks,
IronChefMorimoto
SetInterval In Preloader Wont Work
Please Help!
I am dynamically loading in an external JPG with a percentage progress preloader. The preload movieclip kicks in and the picture loads but the progress will only show 0%
I've tried different variations of the setInterval part of the code but it still just shows 0%. I am probabley missing something very obvious, please put me out of my misery!
Thanks.
The code i'm using is:
PHP Code:
MovieClip.prototype.loadDynamicImage1 = function(imageToLoad) {
this.createEmptyMovieClip("mcPreloadholder", 1);
this.mcPreloadholder.attachMovie("mcPreloader", "mov2", 0);
this.createEmptyMovieClip("mcImageholder", 0);
this.mcImageholder.createEmptyMovieClip("mcImage", 1);
this.mcImageholder.mcImage.loadMovie(imageToLoad);
this.mcImageholder._visible = false;
this.startPreload ();
this.loadCheckID = setInterval(this.startPreload (), 100);
}
MovieClip.prototype.startPreload = function() {
this.onEnterFrame = function() {
percentageImage = int(this.mcImageholder.mcImage.getBytesLoaded()*100/this.mcImageholder.mcImage.getBytesTotal());
this.mcPreloadholder.mov2.percent.text = Math.floor(percentLoaded) add "%";
if (this.mcImageholder.mcImage.getBytesLoaded()>1 && this.mcImageholder.mcImage.getBytesLoaded()>=this.mcImageholder.mcImage.getBytesTotal()) {
this.preloadComplete();
clearInterval(loadCheckID);
this.loadDone();
}
};
};
SetInterval Doesn´t Work At Server
hello, I am making a scroll that depends on the "drag" position (drag is a movieclip) and, I did a setInterval to control the drag position in event on roll over....every things work ´perfectly at home, but when I put it on a server, the set interval is more slow, the interval that I am using is 1 milliseconds, but at server it seems 10 milliseconds....
what could it be??
this is the link to my page
www.chan.art.br
to see the effect, click on "Fotos" and the pass the mouse over the fotos below....it should be faster then it is in fact
thank you all
Chan
If Statement & SetInterval Wont Work?
hey out there,
i've a real simple battery level monitor that's fictitiously sets a level indicator.
there's a function that's called using setInterval:
Code:
stop();
batLevelNo=100;
batLevel="(100%)";
function setBatLevel() {
batLevelNo = batLevelNo-20;
batLevel = "("+batLevelNo+"%)"
bar._x = bar._x-5;
}
if (batLevelNo > 0){
setInterval(setBatLevel, 500);
}
the thing is, i want to stop calling the function when the batLevelNo gets to 0 - but the:
Code:
if (batLevelNo > 0){
setInterval(setBatLevel, 500);
}
doesn't work, it just keeps going.
i have a feeling this is something obvious and i'm being a spoon, does anyone have any suggestions?!
many thanks,
jake
SetInterval + Dynamic Txtfields = Don't Work
hello all,
i'm having trouble using setInterval() to delay some textfields. they textfields are dynamically generated and i can animate the just fine using a for loop or an if statement...i just can't figure out how to get setInterval() to delay the iteration...
Code:
anim = function(a){
for(a=0; a< _global.bldgFacts; a++){
this.holder_anim["facts" + a]["factstxt" + a]._x +=(400-this.holder_anim["facts" + a]["factstxt" + a]._x)/20;
}
}
this.onEnterFrame {
a=0;var myInterval(anim, 5000);
}
i've tried a billion different things a billion different ways and haven't done anything but confuse myself!
thanks!
Help Getting Timer Based On SetInterval To Work
I'm building out the basic code for a timer that does 2 things:
Counts down "bonus points" -- 10th of the total milliseconds in the timer
Count down seconds and tenths of seconds
The bonus points will tick down along with the time -- this is part of a larger quiz interactive project that I'm putting together.
I can't quite figure out the following (my math is bad, I think):
Why can't the setInterval fire off in 1 millisecond increments? Is it too fast for the Flash Player to handle?
What's wrong with my math for the milliseconds on the time? I'd like to ONLY show 10ths of a second instead of thousandths.
The file is attached. Feel free to use it for whatever, if you like. I just need some input on the issues above.
Thanks,
IronChefMorimoto
How Do I Make Setinterval Work In Main MC
good day all
merry christmas and a happy new year to all
please can someone tell me how i can make a SetInterval code work for mii please this is the code am using
fastFrames = function(){ myMovie_mc.nextFrame(); updateAfterEvent(); } speedyID = setInterval(fastFrames, 40);
when i use it with for example a small animation and test the movie it works well well when i export it as a SWF file and test it again it still works BUT when i import the same swf, MC into a main MC it stops working and somehow the mc changes from a mc symbol to a graphic symbol and i aint got a clue what that means anyone who understands please help mee for chrismas sake tanks alot all i got the code from here http://www.kirupa.com/developer/acti...tinterval2.htm
SetInterval Doesn´t Work At Server
hello, I am making a scroll that depends on the "drag" position (drag is a movieclip) and, I did a setInterval to control the drag position in event on roll over....every things work ´perfectly at home, but when I put it on a server, the set interval is more slow, the interval that I am using is 1 milliseconds, but at server it seems 10 milliseconds....
what could it be??
this is the link to my page
www.chan.art.br
to see the effect, click on "Fotos" and the pass the mouse over the fotos below....it should be faster then it is in fact
thank you all
Chan
If Statement & SetInterval Wont Work?
hey out there,
i've a real simple battery level monitor that's fictitiously sets a level indicator.
there's a function that's called using setInterval:
Code:
stop();
batLevelNo=100;
batLevel="(100%)";
function setBatLevel() {
batLevelNo = batLevelNo-20;
batLevel = "("+batLevelNo+"%)"
bar._x = bar._x-5;
}
if (batLevelNo > 0){
setInterval(setBatLevel, 500);
}
the thing is, i want to stop calling the function when the batLevelNo gets to 0 - but the:
Code:
if (batLevelNo > 0){
setInterval(setBatLevel, 500);
}
doesn't work, it just keeps going.
i have a feeling this is something obvious and i'm being a spoon, does anyone have any suggestions?!
many thanks,
jake
Create Setinterval Doesn't Work
Hi,
I used a tut found on this forum made by dynamozx3, it worked great for me in one swf (everything on same timeline) but now it seems I have a path problem....
-menu buts are in maintimeline level0
- actions on but is for the swf on level1
Code:
b1.onRelease = function() {
_level1.gotoAndPlay("out");
this.delay = setInterval(Delegate.create(this.clipLoad),1000);
};
function clipLoad(){
loadMovieNum("me.swf", 1);
clearInterval(delay);
};
The first part works, level 1 goes and plays "out", but then nothing happens , the next movie is not loaded...
Maybe the "this" is not referring to the right level ???
Pleassssseee help me out ????
Thanks,
Irene
RETURN Doesn´t Work Within A Function SetInterval ?
Hello...
I found out a weird behaviour which i cannot explain....
If I have a function, with a setInterval within, and a "return" statement within the setInterval... return does not work!!!
I cannot find an easy workaround and I am a bit stuck... found a solution but with too many if/else... I dont like it much...
Did this happen to you too?
SetInterval: Scope Works Then Doesn't Work
I've created loads of classes that use setInterval. Each time I use the following syntax:
Code:
class myClass{
private var myInterval:Number;
public function myClass() {
setInt();
}
private function setInt():Void {
myInterval = setInterval(this,"foobar",100);
}
private function foobar():Void {
trace(this);
}
}
I would get :
[Object Object] over and over and over
which would be expected.
And usually that works...but today I had a class that wouldn't work that way. When i ran the code above, it didn't set the interval at all. To get it to work I needed to write it like this:
Code:
class myClass{
private var myInterval:Number;
public function myClass() {
setInt();
}
private function setInt():Void {
myInterval = setInterval(foobar,100);
}
private function foobar():Void {
trace(this);
}
}
the interval is called but the trace says undefined. if I pass an argument into the code:
Code:
class myClass{
private var myInterval:Number;
public function myClass() {
setInt();
}
private function setInt():Void {
myInterval = setInterval(foobar,100,this);
}
private function foobar(passedItem:Object):Void {
trace(passedItem);
}
}
It traces [Object Object] again
The first code seems kosher and works everywhere but not in one class. anyone have a problem similar to this?
-D
Will It Conflict At Some Circumstance If Two Or More "setInterval" Work Together?
now i am working in a RPG game ,and use two "setInterval" to make the hero and the maze moveing.but i found at some circumstance the hero may step out of the maze!
as the swf file show, use arrow key to control the hero.it works fine. and step to the transtition door ,which is in the right corner,and then move the hero to the transition door again(do not be confused,the swf will show everything) ...serval times later,the hero may step out of the maze!
i have traced the setinterval,it seems to be the crux
do anybody has some experience at the same problem? two "setinterval" work together may cause some unknown problem?!
please download the attach file!
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.
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();
Drop Menu : Rollovers/GetURL In A Movie Don't Work...and The SWF Doesn't Work In FF
My links/rollovers don't work in Mozilla and the dropdown menu part don't work (the rollovers and the getURLs) in any browser.
What's wrong with this??? I think it's something simple.
I've already tried:
Code:
this._lockroot = true;
I also tried writing the AS as:
Code:
one.title.text = "The Text";
one.onRollOver = over;
one.onRollOut = out;
function over () {
this.gotoAndPlay(2);
}
function out () {
this.gotoAndPlay(11);
}
one.onRelease = function(){
getURL("http://www.thelink.com");
}
...didn't work...
I hope someone can help!
Download the: Source File
(Lately I've gotten no help off this site and it's been very depressing because this site people used to be very helpful...I hope someone can change my mind)
This._lockroot Doesn't Work (combobox Components Won't Work)
I have a preloader (preloader.swf) which loads a form (offerte.swf).
I've put the this._lockroot on the "application" timeline on the first frame of the "Flash form application" (offerte.swf).
But the combobox components still won't work.
I had it working before, but suddenly it seemed to stop! Now I can't get it get to work again.
Preview: www.blaak.nl/flash/
This._lockroot Doesn't Work (combobox Components Won't Work)
I have a preloader (preloader.swf) which loads a form (offerte.swf).
I've put the this._lockroot on the "application" timeline on the first frame of the "Flash form application" (offerte.swf).
But the combobox components still won't work.
I had it working before, but suddenly it seemed to stop! Now I can't get it get to work again.
Preview: www.blaak.nl/flash/
LoadMovie Work But Send Variable Not Work On Mac.
Hi!
I have many swf files that I want it link to specify frame.
AT Level0(bg.swf ): I set two variable as glob_marker, glob_scene for keep frame label and scene from Level5 for load Level8 and goto that label. action at frame be:
glob_scene = "";
glob_marker = "";
loadMovieNum ( "movie1.swf", 5 );
Inside Level5(movie1.swf): I set action to buttons be:
on (release) {
_level0.glob_scene = "5";
_level0.glob_marker = "5-1";
loadMovieNum ("movie2.swf", 8);
}
Level8(movie2.swf ): I set action to first frame at root be:
dis = _level0.glob_scene;
if (dis eq "5") {
gotoAndPlay ("IC", "LL");
} else {
gotoAndPlay (3);
}
And Level8(movie2.swf ): Inside "IC scene" I set action to first frame be:
display = _level0.glob_marker;
if (display eq "5-1") {
gotoAndPlay ("IC1", "IC1");
} else {
loadMovieNum ("orher.swf", 20);
gotoAndPlay ("IC1", "IC1-1");
}
Everything work fine on PC.
It go to scene and label right.
But for Macintosh it not go to scene and label (movie2.swf) as I want, it go to first scene and first frame.
(Everything play on CD by have projector from Flash Not preview with Browsers)
I sorry for my english. Thank you.
Including A Font Don't Work For IE 6.0, And DOES Work For Netscape?
This is weird,
I included a font into Flash 5 and when I view the flash content on another pc (that don't have the included font installed) with Internet Explorer 6.0 it gives me some ugly other font, and for Netscape 4.0 it works perfect!
Does anyone know about this problem?
Please reply if you know something that could solve the problem
Thank you
Why Would Flash Movie Work At Home & Not At Work?
I've verified the javascript works. I verified that my ActionScript works - at home anyway - in Firefox and IE6. When I brought my code from home and ran it on my work computer, the Javascript function fails to execute in Firefox! Firefox! Then, the JavasScript function fails to execute in IE7, which I halfway expected...
The strange part in all this is that when I use Firefox's IE view plugin (views Internet Explorer as a tab in Firefox), the Flash movie is fully active - it calls the javascript function as intended, The hyperlinked movieclips open new pages as expected, etc. Why is this?
I need this movie to function here at work the way it functioned at home! I know that ActionScript works the way it should where ever you use it... The JavaScript isn't to blame - I know it works in all the browsers I use... In both cases, home and work, I've ran all my files (HTML, SWF) from the same directory, so I'm not worried about conflict between realative and abolute paths...
Does it have something to due with Flash security settings? Does it have something to do with the HMTL object tags I'm using? That's the only thing I can think of.
This is work-related. Please help!
Attach Code
>>The AS2 is simple:
import flash.external.ExternalInterface;
closeDiv_btn.onPress = function() {
ExternalInterface.call("disappear");
}
>>The javascript is lenghtly so I won't show it here, but I've verified that the function works and is properly named "disappear()".
>>Here's the HTML object tag:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
width="500" height="300" title="Hover Ad">
<param name="allowScriptAccess" value="always" />
<param name="movie" value="myMovie500x300.swf" />
<param name="quality" value="high" />
<embed src="myMovie500x300.swf" quality="high"
pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" width="500" height="300"></embed>
</object>
Edited: 05/30/2007 at 12:57:31 PM by JaeWebb
Smoothing Doesn't Work It Oughta Work
Hello!
I am trying to develope this website:
http://anarchy.primalinsanity.com/~villain/nma.rar
Its smoothing effect, however, has mysteriously disappeared. It is only enabled in authoring mode, not if I export the movie. I've tried everything to re-enable it:
1) Changed formats from JPG to PNG
2) Library > Bitmap Properties > Allow smoothing
3) File > Publish Settings > Smooth
But nothing seems to work
Thanks everyone,
Johann
Guestbook & Counter Work Don't Work On Server
I've created a counter and a guestbook with flash and php using a txt file to store information. it all worked fine when i tested it on the tripod.de server with one of my accounts. however it doesn't work if i load it up on another account on www.tripod.de. i did activate php on this acount but that's not the problem...
i'll give u both links, ...
here ithe guestbook works
debwebflash guestbook
here the counter works:
debwebflash counter
here i want it to work!
donboscoduisburg
well this last page is in german, so to get to the guestbook u have to click on the link "Gästebuch" further down on the list on the left. the counter is on the left and doesn't work eigther. both don't write into the .txt file for some reason.
thanks, hope someone can help.
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!
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!
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
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.
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!
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...:-(
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!
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
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;
}
}
SetInterval
Hello
Please help... What should I fix in this script to make the circles appear one by one with particular interval of time?
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?
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
|