Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Loading Bar Is Repeating


OK here it is:, I have set up a loading screen for much of the website. However when I load external swfs into my movie, the loading bar on those movies will sometimes repeat several times before actually going to the frame it is supposed to after the loading is complete.

jnads




FlashKit > Flash Help > Flash MX
Posted on: 07-16-2003, 12:34 PM


View Complete Forum Thread with Replies

Sponsored Links:

Loading A Random - Non Repeating Variable
OK - here is my situation...

I am using a Random code - to grab a random variable from a playlist -

PHP Code:



function radioNext () {
    var max = objRadio.arrStations[intStation].arrSongs.length;
    var num = Math.floor(Math.random()*max);
    intSong = num;
    if (intSong>=objRadio.arrStations[intStation].arrSongs.length) {
        intSong = 0;
    }
    radioPlay();




radioNext is called at the end of each track - and it grabs another random song.

what i want to do - if possible - is eliminate - as best as possible the songs repeating themselves.

In the end there is going to be a HUGE library of songs.. and to think of having over 300 songs - and still catch a few repeating is a bit dishearnening.

any help is appreciated

View Replies !    View Related
Loading Random Jpgs In Several Mcs Without Repeating. ( How? )
Hello,

well i have 3 mcs (mc1,mc2,mc3), each loads .jpg files in it randomly. The question is how to make each of them not repeat previously loaded one.

Example of code that im using


Code:

filename = ["image"+random(7)+".jpg"];
path = "img/";
i = filename.length;
k = Math.floor(Math.random()*i);
loadMovie(path+filename[k], mc1);
for example sometimes mc1 would load image1.jpg and others would load the same and so on. how to avoid such repeating ?



thanks

View Replies !    View Related
[F8] Avoiding Repeating Swfs When Loading Random Movies
Hello,

I've got a flash movie in which random movies are loaded one after another, using this code;


Code:
var mc = this.createEmptyMovieClip("mc", 1);
function nextRandom() {
var swf = this._url.substr(0, this._url.lastIndexOf("/")+1)+"../images/swf/image"+Math.floor(Math.random()*10)+".swf";
mc.loadMovie(swf);
}
nextRandom();
this.onEnterFrame = function() {
if (mc._currentframe>=mc._totalframes) {
nextRandom();
}
};

which works fine. However, with this, there's nothing that says that one swf can't be loaded again and again. Not good. Can someone help me by suggesting some lines of code that will prevent the same swf from repeating? It would be much appreciated!

Cheers
Jakob

View Replies !    View Related
Making 3 Sets Of Non-repeating #'s And Non-repeating #'s Within The Sets
Hey guys,

How would you go in making 3 sets of non-repeating #'s. Every time I click an MC, there's a number associated with it and should be removed from the following set.

Like this:

1st set: 6#s, 0-11
2nd set: 5#'s, (0-11)-1stMcClicked
3rd set: 4#'s, (0-11)-(1stMcClicked && 2ndMcClicked)

I'm using Senoculars function:


ActionScript Code:
function RandomNumbers(c) {
    var r, p, i = c, n = new Array(c);
    while (i--) {
        n[i] = i;
    }
    while (c--) {
        r = random(c);
        p = n[c];
        n[c] = n[r];
        n[r] = p;
    }
    return n;
}
randomNumbers = RandomNumbers(11)
And getting 6 #'s from a choice of 12, like so:



ActionScript Code:
randomNumbers.splice(6);


The tricky part is to tweak Senoculars function, frankly because I don't understand it, and add exceptions.

Then, I tried something different:


ActionScript Code:
//Cred. to Senocular
function RandomNumbers(c) {
    var r, p, i = c, n = new Array(c);
    while (i--) {
        n[i] = i;
    }
    while (c--) {
        r = random(c);
        p = n[c];
        n[c] = n[r];
        n[r] = p;
    }
    return n;
}
///Remove specific value from an array---***
function remItem(arr, item) {
    tempArray = [];
    for (i=arr.length-1; i>=0; i--) {
        if (arr[i] != item) {
            tempArray.push(arr[i]);
        }
    }
    tempArray.reverse();
    arr = tempArray;
    return (arr);
}
var set1Array:Array = new Array();
var set2Array:Array = new Array();
var set3Array:Array = new Array();
var tempArray:Array = new Array();
var setArray:Array = new Array(set1Array, set2Array, set3Array);
var ammountToStart:Number = 5;
var totalChoices:Number = 11;
var currentSet:Number = 1;

function makeRandomSets(currentSET, ammountToStartWith) {
    switch (currentSET) {
        case 1 :
            tempArray = RandomNumbers(totalChoices);
            set1Array = tempArray.splice(5);
            trace(set1Array);
            tempArray = [];
            break;
        case 2 :
            tempArray = RandomNumbers(totalChoices);

            for (i=0; i<set1Array.length; i++) {
                if (set1Array[i] == tempArray[i]) {
                    tempArray = remItem(tempArray, set1Array[i]);
                }
            }
            tempArray.splice(5);
            set2Array = tempArray;
            trace(set2Array);
            tempArray = [];
            break;
        case 3 :
            tempArray = RandomNumbers(totalChoices);

            for (i=0; i<set2Array.length; i++) {
                if (set2Array[i] == tempArray[i]) {
                    tempArray = remItem(tempArray, tempArray[i]);
                }
            }
            tempArray.splice(4);
            set3Array = tempArray;
            trace(set3Array);
            break;
        default :
            trace("****ing error");
    }
}

makeRandomSets(currentSet,ammountToStart);

and on a button:


ActionScript Code:
on (release) {
    _root.ammountToStart--;
    _root.currentSet++;
    makeRandomSets(_root.currentSet,_root.ammountToStart);
}
Example trace:


Code:
3,0,9,1,8,6
9,10,0,2,6
7,6,10,9
As you can see, numbers repeat...

I know that my function isn't going to work, it's testing values consequentially. ([0] & [0], [1] & [1], etc etc...)

So?

Anyone...?

Ideas?

View Replies !    View Related
.swf Repeating
Hi all I´m new here
I have a symbol (movieclip)that is repeating when I export the swf-why is it doing this? Am I using the right symbol type for this, should it be a graphic? The fla is attached thanks for any pointers

View Replies !    View Related
Repeating MCs
I know that MCs keep looping, but is there a way I can set it to stop after a certain number of loops? There's the stop(); way on a layer, but can I take the guesswork out of it and just make it stop?

Thanks in advance for any replies.

View Replies !    View Related
Repeating MC
I know that MCs keep looping, but is there a way I can set it to stop after a certain number of loops? There's the stop(); way on a layer, but can I take the guesswork out of it and just make it stop?

Thanks in advance for any replies.

View Replies !    View Related
Mp3 Keeps Repeating. I've Tried And Tried To Fix It
I bought a custom flash template and have been able to fix everything the way I need it except for the music player. It will play the first song and then when it is finished, it will play it again.

If I push the next button it will go to the next song, but I would like it to be able to do that on its own.

I also was wondering if there would be a way that I could get the Title of the mp3 that is playing to be shown.

If you would like to see what I'm working with, pm me and i'll show you the site.

Thanks.

View Replies !    View Related
A Repeating Mc
i'm trying to simply make an animation repeat every few seconds with a bit of actionscript but it's not working properly. Here is the code i've written:



Code:
var speed:Number;

speed= 1000;

function pourOil():Void{
oilDrip_mc.duplicateMovieClip('new_oil',getNextHighestDepth)
}

setInterval(pourOil,speed);

Now, i thought this might work but it's not really working properly. It seems to repeat the movie but keeps on cutting out the other ones that it started. I'm just guessing but i think it has to do with the new movie clips not having a unique name? (in the duplicateMovieClip i just put 'new_oil'). There might be a neater way of doing this.

Can anybody help? That would be great, thanx

View Replies !    View Related
Repeating
I'm trying to figure out how to make some text glow randomly red repeatedly.

I have created the text as an object, added randomly placed Keyframes and used 50 frames. I changed the colour red on every other keypoint and then on the final frame added the action:

Stop () ;
gotoAndPlay (1) ;

But whenever I play the section of animation in the editor or on the main stage it won't repeat the object's animation. Can anyone help?

Uni

View Replies !    View Related
Repeating
How do I stop my animations from repeating over and over again?

View Replies !    View Related
A Repeating Mc
i'm trying to simply make an animation repeat every few seconds with a bit of actionscript but it's not working properly. Here is the code i've written:


Code:
var speed:Number;

speed= 1000;

function pourOil():Void{
oilDrip_mc.duplicateMovieClip('new_oil',getNextHighestDepth())
}

setInterval(pourOil,speed);
Now, i thought this might work but it's not really working properly. It seems to repeat the movie but keeps on cutting out the other ones that it started. I'm just guessing but i think it has to do with the new movie clips not having a unique name? (in the duplicateMovieClip i just put 'new_oil'). There might be a neater way of doing this.

Can anybody help? That would be great, thanx

View Replies !    View Related
Repeating
I'm trying to figure out how to make some text glow randomly red repeatedly.

I have created the text as an object, added randomly placed Keyframes and used 50 frames. I changed the colour red on every other keypoint and then on the final frame added the action:

Stop () ;
gotoAndPlay (1) ;

But whenever I play the section of animation in the editor or on the main stage it won't repeat the object's animation. Can anyone help?

Uni

View Replies !    View Related
Repeating
How do I stop my animations from repeating over and over again?

View Replies !    View Related
Radom() WITHOUT Repeating ?
HELP !!!

trying to create a func that will randomly access an Array of values without repeating any of the values and then STOP

i've tried to use the .splice method to add the individual vaules from one array to a new array and then compare the two but to no avail.

having trouble comparing multiple values of an array at once to a variable or to the vaule of another array --- if anyone could solve this part i think i can figure out the details

thanx allot
i haven't slept in days because of this

- michael dragich
dragich@mich.com

View Replies !    View Related
..::Repeating Movie::..
I have a movie that I need only certain parts to loop continuously.

For example a grainy movie
I want the background to have images fade in/out and then stop but the grainy quality (moving lines back and forth) to repeat over and over.

Thanks

View Replies !    View Related
Non-repeating Randomization
I have a movie clip broken up into 14 different frame labeled sections. Each section contains a paragraph of text. How can I randomly jump to different frames without repeating. So that the user can view the different paragraphs without seeing the same information twice?


thanks
rhombus23

View Replies !    View Related
DupMovClip ERR When Repeating? .. HELP
Ok, i have a flash file (a dumbed down version so I could test this error I'm having in this game I'm working on) that removes movie clips when new ones are created. I've checked the syntax many times, and played with the numbers, but, linearly speaking, the first batch of Dup'd movies that appears are removed as the second batch appears. ie: MCa-1, MCa-2, MCa-3 are created, THEN the next set of MC created (different names for them) MCb-1, MCb-2, MCb-3 start removing MCa-1 and MCa-2!!

here is the code, it's long and ugly b/c I took out the while loop to ensure the steps were right, but you'll see the while loop is commented out.

I placed this in a MC on the stage that is not duplicated.

onClipEvent(load) {
v_Test = 1;
v_Test2 = 1;

// duplicate them and make them tall
_root.c_Circle.duplicateMovieClip(["c_Tall" + v_Test], v_Test);

with (_root["c_Tall" + v_Test]) {
_x = v_Test * 20;
_y = 200;
_yscale = 150;
}

v_Test ++;

_root.c_Circle.duplicateMovieClip(["c_Tall" + v_Test], v_Test);

with (_root["c_Tall" + v_Test]) {
_x = v_Test * 20;
_y = 200;
_yscale = 150;
}

v_Test ++;

_root.c_Circle.duplicateMovieClip(["c_Tall" + v_Test], v_Test);

with (_root["c_Tall" + v_Test]) {
_x = v_Test * 20;
_y = 200;
_yscale = 150;
}


// same as this "commented out" while statment

// v_Test = 3;
// while (i_Test < v_Test) {
// i_Test ++;
// _root.c_Circle.duplicateMovieClip(["c_Tall" + i_Test], i_Test);

// with (["c_Tall" + i_Test] + i_Tall) {
// _x = i_Tall * 20;
// _y = 200;
// _yscale = 150;
// }
// }

// switch to wide

v_Test2 ++;

_root.c_Circle.duplicateMovieClip(["c_Wide" + v_Test2], v_Test2);

with (_root["c_Wide" + v_Test2]) {
_x = v_Test2 * 20;
_y = 200;
_xscale = 150;
}

v_Test2 ++;

_root.c_Circle.duplicateMovieClip(["c_Wide" + v_Test2], v_Test2);

with (_root["c_Wide" + v_Test2]) {
_x = v_Test2 * 20;
_y = 200;
_xscale = 150;
}

v_Test2 ++;

_root.c_Circle.duplicateMovieClip(["c_Wide" + v_Test2], v_Test2);

with (_root["c_Wide" + v_Test2]) {
_x = v_Test2 * 20;
_y = 200;
_xscale = 150;
}


// same as this "commented out" while statement
// v_Test2 = 3;
// while (i_Test2 < v_Test2) {
// i_Test2 ++;
// _root.c_Circle.duplicateMovieClip(["c_Wide" + i_Test2], i_Test2);

// with (["c_Widel" + i_Test2] + i_Tall2) {
// _x = i_Tall2 * 20;
// _y = 200;
// _xscale = 150;
// }
// }

}

View Replies !    View Related
Music Repeating?
I have a simply question hopefully, I have a song in my flash movie and before the song finish to play, the same song starts at the beginning playing again. So the song is playing in two different parts at the same time. How do I get the song to play from beginning to end without be interupted??

View Replies !    View Related
Repeating Actionscript...
I have a script that duplicates movie clips, but I want to have the user specify how many clips are duplicated, how do I do this?
there will be an input text box for the variable of how many clips to duplicate...

HELP ME!!!!!

View Replies !    View Related
Repeating Script
My script works but it only works once, i want to be able to have the script work an infinite amount of times when I press the space bar here is the script i am using

onClipEvent (enterFrame) {
shothrust = 8;
if (Key.isDown(Key.space)) {
xshot += shothrust*Math.sin(math.pi/180);
yshot += shothrust*Math.cos(math.pi/180);
}
_y -= yshot;
_x += xshot;
}

I know I am probley missing something small, but I need help

thanks in advance

View Replies !    View Related
Repeating Script
My script works but it only works once, i want to be able to have the script work an infinite amount of times when I press the space bar here is the script i am using

onClipEvent (enterFrame) {
shothrust = 8;
if (Key.isDown(Key.space)) {
xshot += shothrust*Math.sin(math.pi/180);
yshot += shothrust*Math.cos(math.pi/180);
}
_y -= yshot;
_x += xshot;
}

I know I am probley missing something small, but I need help

thanks in advance

View Replies !    View Related
AttachSound Repeating
I've attached a sound to _root, for background music.
code: song = new Sound();
song.attachSound("upbeat");
_root.onLoad = song.start();

how do I get it to loop continiously? using AS. it's easy if I attahc it to a timeline but im importing it at runtime

View Replies !    View Related
AttachSound Repeating
I've attached a sound to _root, for background music.
code: song = new Sound();
song.attachSound("upbeat");
_root.onLoad = song.start();

how do I get it to loop continiously? using AS. it's easy if I attahc it to a timeline but im importing it at runtime

View Replies !    View Related
Overlapping Repeating MCs
Ok, I think this is going to be simple but I can't do it. How can I have a movie clip duplicate itself when it is half way through, and delete itself when it's ended so that it will always show two movie clips staggered?

View Replies !    View Related
Sound Repeating?
i have a sound that i want as a background to my movie. however, when i say gotoAndPlay(1); it repeats the sound. how do i have it so that theres a sound thats in the background, but not repeating?

thnx

View Replies !    View Related
Repeating A Layer
Heres the dealio.
I have 3 stop commands thoughout my time line to pause my scene until a button triggers it to start playing wherever.
What I want to do is have a about 4 layers repeat them selves after frame xx in the time line. None of them will play before frame xx, just continously througout the rest of the time line.
Im racking my brain trying to think of code that will work and have searched a bizillion pages trying to find an answer.

iaskwhy, if you read this, you mentioned in another thread about never to use gotoAndPlay ("scene1",1), because it never works.
I was about to commit myself to an insane asylum, I thought I was going crazy. Your suggestion on using _root saved me alot of anguish.
Thanks bro!

Josh

View Replies !    View Related
Repeating Scrolling BG
K I'm New And I Started Making a game. I used a tutorial on this website to make a ship shooting game like space invaders.

I have star background that i want to repeat over and ovwr going down so it looks like its moving up.

View Replies !    View Related
Repeating Movie Help
In the scene i created i have a ring that i want to rotate all the time; it has 50 frames which are all movie clips. When the scene loads you see the ring spinning and 4 pictures in each corner that shape tween to words that are on top and bottom of ring which is in center of screen. My question is how do I keep ring spinning after the pictures tween to words. I will also have a button that goes to rest of website that appears after the words appear. If anyone wants to look at the code go to

http://f2.pg.briefcase.yahoo.com/bc/....dir=/&.view=l and d/l it. sorry for file size I know its bloated.

View Replies !    View Related
Repeating Array
Something I am working on uses large arrays to store information.
The thing is the way I have broken up the information some arrays are effectively repeated.

So, I have:

myArray1 = [--Large Array1--]
myArray2 = [--Large Array2--]
myArray3 = [--Large Array2--]

but I could reduce it like so:

myArray1 = [--Large Array1--]
myArray2 = [--Large Array2--]
myArray3 = myArray2

Now, obviously if only on the level that it saves me copying a huge array out saying arrayA = arrayB works for me.
But I wondered if this could cause any problems for me later on, and I also wondered that when the swf is compiled is the size going to be reduced by this method?

View Replies !    View Related
Repeating Animation
i have a new question.

i am creating an animation with a character walking. i have animated him walking a complete step. is there anyway to get this animation to repeat but going forward. so then i don't have to hand animate the next ten steps.

thank you in advance.

View Replies !    View Related
Repeating Offset (?)
I apologize if this has been discussed before, however I don't have a clue what to call it. I'm trying to do what www.corbis.com does on their home page.

Would someone be kind enough to tell me what this is called or possibly post a link for a tutorial.

Thanks in advance!

View Replies !    View Related
Repeating Motion?
I'm kinda new to the forums, also to flash. None of my friends work with flash so I guess I'll have to get help here. I want a motion to repeat non stop until you stop it or until it goes to the next scene. Like, something can be running across the screen, and you pause it, and it's still running in place. If anyone could help, I'd be pretty happy. Thanks.

View Replies !    View Related
Stop Repeating
i made a banner
it shows a letter every 10 frames like:
frame 10: F
frame 20: Fr
frame 30: Fre

until it spells Fresh Talent
it lasts 110 frames

each letter is a MC and another MC contains all the letters

when it displays the last letter (t) i want it to stop repeating

how can i do that

View Replies !    View Related
Not Repeating The Same Question
Hi guys.

I'm developing a small maths game for my kids. I've got it working OK with a scoring system, but the only problem I cant figure out, is how to make sure that the program does not ask the same question twice.

The game shows 10 random questions (out of 100 that I've made) and keeps score, but it occasionally shows the same question twice.

Anybody now of a way of telling the game not to show the same question twice?

Leroy

View Replies !    View Related
Repeating Header
I am new to this forum and to many functions in flash as well. I have a template I am working with and the header keeps repeating or looping when the web page loads. It actually begins the repeat after the loader and then the image begins to display. I would really like to use a flash header, so if anyone would be so kind and patient with me to explain what could possibly be going wrong, I would be very grateful and relieved. The page is at:

http://www.tvillecog.org/index.html

Thank you,

Jennifer

View Replies !    View Related
Repeating Button
Is there a way to make a button in flash that repeats when you hold it down? I have this code so far:
on (press) {
_root.button._yscale+=5
_root.button._xscale+=5
}

I am obviously having the button cause a zoom in.

Thanks for the help!

View Replies !    View Related
Non-repeating Random
Hi! Is there some code or method that i can use that will make it so the random(30) code i am using won't repeat numbers?

Thanks,

Lex

View Replies !    View Related
Non Repeating Array
Hello. I have an array with questions I am using for a quiz. The questions are randomly being pulled out of the array.How can I make it so it will not ask the same question twice until it has asked all the questions in the array at least once.

So I need this array to ask all questions once, then start over again randomly asking the same questions.Hope that makes sense.

Thanks
Jamesloacher

View Replies !    View Related
Repeating A Part
I want to make a flash animation of a logo that makes an entrance (it appears by fading in). Then i want to make it flash on and off but this flashing i want it to happen non stop. How can i make it loop endlessly after the part of its entrance? In other words after it enters to the stage i want it to flash on and off without stop!

View Replies !    View Related
MC Not Repeating Correctly [F8]
Have a MC with 91 frames

Frame 1 has 2 layers; actions layer with stop(); and a layer with a start button -
Button has gotoAndPlay(33)

Frame 33 thru 91 has various layers with nav buttons tweens and AS stop();'s sprinkled throughout.
There is a common "exit" button within all these frames with a gotoAndPlay(2)

Frame 2 thru 32 is a "exit sequence" tween

on Frame 32 ,to get me back to Frame 1, placed:

onEnterFrame = function() {
gotoAndStop(1)
}

//also tried gotoAndPlay(1) as I don't think it should matter with the AS of stop(); in Frame 1

EVERYTHING works perfectly throughout the entire MC, buttons, tweens, exit sequence, etc.

HOWEVER, whenever I hit the "exit" button, run through the "exit sequence" and then land back on Frame 1 and then press the original "start" button, it appears to only flash Frame 33 and then seems to land me back on Frame 1 with the start button again.

My brain is telling me this should work but I'm still new to this.

Any ideas appreciated.

View Replies !    View Related
MovieClipLoader Repeating :-(
I am using the code below to load in an external MC, and all is good. Apart from once the MC has run, it simply loops back and plays again.

I have NO control over the external SWF as it is being published outside of Flash so I cannot add anything as simple as a stop(); command.

Any help would be greatly appreciated.

Mike


Code:
var loadListener:Object = new Object();
loadListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
loadingtext.text = +bytesLoaded+" bytes of "+bytesTotal;
mc.stop();
};
loadListener.onLoadComplete = function(target_mc:MovieClip):Void {
loadingtext.text = "";
ManGFX._alpha = 100;
mc._alpha = 100;
mc.play();
};
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(loadListener);
var mc:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
mcLoader.loadClip("Talking_Man.swf", mc);

View Replies !    View Related
[CS3] Nav Bar Using Flashvars Not Repeating MC's
Hey all,

A nOOb here. I am designing a nav bar that will link to a HTML (.php) site. I want each link to goto the right page and when on that page I want the selected pages text to be highlighted and not able to animate. I know I can do it by repeating the MC and using frames for every page but I'm in this to grow and learn. Is there a way using flashvars to use the MC I have made and do what I want? I've included a .fla of what I have.

So basically a nav bar, keep intro animation, selected text change color with no animation. All going to a .php.

Also can anyone recommend a easy to understand, like Sesame Street easy, book to learn these techniques?

Thank you

View Replies !    View Related
Repeating Script
Hi,

I have movie clips on stage pos0, pos1, pos2...pos83. and I want to make this scrip for all pos movie clips. Is there are any way of writing this better instead of repeating the script 84 times. i.e in this script I have pos1 and next would be pos2 etc.

match1.onPress = function() {
this.startDrag();
};
match1.onRelease = function() {
this.stopDrag();
if (eval(this._droptarget) == pos1) {
match1._x = pos1._x;
match1._y = pos1._y;
}
};

Many thanks for help!

View Replies !    View Related
Repeating A FLV Video
I am trying to create a background that's a repeating FLV video... the problem is each time the video reaches its end it doesn't automatically repeat and play.

How can I get the FLV to automatically repeat and play on a loop?

View Replies !    View Related
Repeating Code
Hey all! I'm working on a bit of a menu in flash, and wanted to know if there is any way to code all of the buttons in one piece of code instead of having each button coded individually? The code is as follows:


Code:
homebutton.onRollOver = function() {
te.fadeTo(homebig, 50);
te.changeWH(this, 30, 30);
te.fadeTo(where, 30);
};
homebutton.onRollOut = function() {
te.fadeTo(homebig, 0);
te.changeWH(this, 25, 25);
te.fadeTo(where, 100);
};

homebutton.onPress = function()
{
te.fadeTo(homesm, 100);
te.fadeTo(hometxt, 100);
set("infoTxt", "Back to the main Homepage of this site! The latest news and information.");
};
For example instead of writing:


Code:
homebutton.onRollOver = function()
Is there any syntax for say:


Code:
*button.onRollOver = function()
Where the star would just do anything with 'button' at the end of the name?

Cheers in advance.

View Replies !    View Related
Repeating Button
I started this script to see if I could get a button to repeat a function. Am I on the right track?


ActionScript Code:
package {
    import flash.display.MovieClip;
    import flash.events.Event;
    import flash.events.MouseEvent;
    public class PhotoLoader extends MovieClip {
        private var nudgeIncrement:Number=1;
        public function PhotoLoader () {
            mLeft.addEventListener (MouseEvent.MOUSE_DOWN,mLclick);
        }
        private function mLclick (event:MouseEvent):void {
            _photo.photoMove (-nudgeIncrement,0);
        }
        public function photoMove (xVal:Number, yVal:Number):void {
            this.x=xVal;
            this.y=yVal;
            addEventListener (Event.ENTER_FRAME, update);
        }
        private function update (evtObj:Event):void {
            this.updatePosition ();
        }
        private function updatePosition ():void {
            this.x++;
            this.y++;
        }
    }
}

I get the following errors.
1061: Call to a possibly undefined method addEventListener through a reference with static type Class.
1061: Call to a possibly undefined method photoMove through a reference with static type Class.

In a previous post someone suggested using a timer to do the repeating but I though I'd try to get this to work.

View Replies !    View Related
URLLoader Repeating Itself
Hi there,

I'm pretty new to Flash and AS3 but I've managed to figure most of my problems out with the help of books and the net...I'm having a problem with a URLLoader and I just cannot work it out.

The problem is that when I click on my buttons that start the function containing the URLLoader, the Loader loads the data repeatedly, as many times as I have clicked on a button. So, for example, if I click a button it will load the data twice. Click again and it loads it three times, again and it loads it four times etc...I know this because I traced the function that runs when the URLLoader is completed (xmlLoader.addEventListener (Event.COMPLETE, xmlLoaded); )

This poses serious problems for me because each time this happens, the loader adds more and more children to the sprite I am loading the data (a simple XML List) and I cannot manipulate the objects correctly. On top of that I'm sure there is a memory problem.

Anyway, I'm sorry this is such a loaded question, but have you run into a problem like this before and do you have any suggestions? Thank you!

View Replies !    View Related
Help With Repeating Action In AS 3
In AS2 it is possible to create multiple movieclips with new instance name using a for loop:

for (var i:Number = 10; i > 0; i--) {

myClip.duplicateMovieClip("newMC" + i, i, {_x:i*10, _y:i*10});

}

How would the similar be done in AS3?

Thanks

View Replies !    View Related
Repeating Code
HELLO,

I have a code that loads an external image or an external swf as a background. the code starts when the user selects an item from the menu and goes to the target frame.

My question is:

do I have to repeat this code everytime in every frame? I am using flash 8, and this is the code

ActionScript Code:
this.createEmptyMovieClip ("loader_mc", 1);


//create a MovieClipLoader
mcLoader = new MovieClipLoader();
//create an object for listener
loadListener = new Object();
//register the loadlistener as a listner of hte mcLoader object
mcLoader.addListener(loadListener);

//load the swf of jpg into the movie clip target
mcLoader.loadClip("final.swf", loader_mc);

//what to do when it starts to load
loadListener.onLoadStart = function (){
    loader_mc.stop();
   
}

//what to do when is downloading
loadListener.onLoadProgress = function (mc, loadedBytes, totalBytes){
    preload = Math.floor(loadedBytes/totalBytes *100);
    bar_mc._xscale =preload;
    loaderText_txt.text= preload +" %";
}
//what to do when is finished
loadListener.onLoadComplete = function (){ 
    loader_mc.play();
    loader_mc._alpha=0;
    myInterval = setInterval (alpha, 10);
    function alpha (){
        if (loader_mc._alpha<100){
            loader_mc._alpha +=1;
        }else{
            clearInterval (myInterval);
        }
    }
           
    loaderText_txt._visible=false;
    bar_mc._visible=false;
           
}

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved