Multi Preload And Loop
Hello all
I'll ask then show the code that i already have.
What i want to do is loop through an array of items, Each item has an image attached to it. But i only want it to go onto the next item once the image has been loaded fully.
I have this wicked code that was kindly donated of someone off this forum.
Now i know that this is possible as i've seen it but i'm not sure how to do it.
Is it possible to adapt the exsiting codes below to perform this task?
this is the code i have at the mo:
step loader:
PHP Code:
function createList(array, i, line, width, count, row) { // if (i == array.length) { trace("list created"); return; } // var spacing:Number = 20.0; var y:Number = (i*spacing); var name:String = "item"+i+"_mc"; listLoader_mc.loader_mc.attachMovie("itemList_mc", name, array.length-i); // listLoader_mc.loader_mc[name].onEnterFrame = function() { // if (listLoader_mc.loader_mc[name]._currentframe == 2) { // if (row == count) { row = 0; line = line+spacing; width = 0; } // listLoader_mc.loader_mc[name]._y = line; listLoader_mc.loader_mc[name]._x = width; // listLoader_mc.loader_mc[name].itemArray[0] = new Object(); for (var e in array[i]) { listLoader_mc.loader_mc[name].itemArray[0][e] = array[i][e]; } } // if (listLoader_mc.loader_mc[name]._currentframe == 3) { //if (movieClip[name]._currentframe == movieClip[name]._totalframes) { listLoader_mc.loader_mc[name].onEnterFrame = null; var nameLength:Number = listLoader_mc.loader_mc[name].nameDark_txt.textWidth; createList(array, i+1, line, width+nameLength+1, count, row+1); } }; }
preloader:
PHP Code:
function startPreload(url) { imageLoader_mc.image_mc.loadMovie(url); attachMovie("preloaderImage_mc", "preloaderImage_mc", 500, {_x:10, _y:55}); onEnterFrame = preloadContainer; } // function preloadContainer() { var loaded:Number = imageLoader_mc.image_mc.getBytesLoaded(); var total:Number = imageLoader_mc.image_mc.getBytesTotal(); imageLoader_mc.image_mc.stop(); imageLoader_mc.image_mc._visible = false; if (total>0) { var percent = loaded/total; preloaderImage_mc.value = percent; if (percent == 1) { imageLoader_mc.image_mc.play(); imageLoader_mc.image_mc._visible = true; preloaderImage_mc.removeMovieClip(); delete onEnterFrame; } } }
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 08-21-2007, 11:34 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Multi Preload
Hi,
I have 3 seperate holder clips on my main stage, into each of these loads a seperate jpeg.
I have a preloader with the % loaded showing and a little 'downloading now animation'
Where do I put the preloader and the animation?
I am guessing that the preloader code can just be a function on the main time line. But where would I put the animation. It can't be the main time line as there needs to be 3 seperate instances. Could I just use attachmovie to put the animations into the relevent holder clip, and would a function be able to work out more than 1 image loading at at time or would the code go on each holder?
Thanks!
Multi-movie Preload Problem
Hi to all,
i will explain first my situation and than the question.
I have a main movie with a preloader in the beginning that loads the content. The content is not only the rest of the main movie ( basically the menues,bitmaps and some fix information like contact and main info about the firm), but also around 10 other swf that have the info for the topics of the menue. The different movies are necessary to mantain a clear structure in the project.
So, and the question is...... How can i preload al this movies within the preloader so that:
1. i get a real feeling about what i have to upload ( percentage, bytes)
2. i dont go throuw a preloader to wait again for every single movie inside the page.
Thanks !!
Multi-column Image Fader - Pause In A For Loop
Here's what I'm doing: I have a content management system written in PHP and MySQL with a page allowing the admin to upload images. These images are supposed to be animated in a Flash movie - specifically, 4 columns, fading at different intervals.
My images load in just fine, it's animating them that I'm having trouble with.
(By the way, if there's a better way to go about this than what I've come up with, please don't hesitate to let me know. I'm still a rookie with ActionScript and am not fully aware of all the capabilities. This is the most complicated ActionScript I've ever written from scratch.)
Frame 1:
PHP Code:
imageinfo = new LoadVars();
imageinfo.load("http://localhost/scripts/header.php");
imageinfo.onLoad = function(success) {
if (success) {
trace("Variables loaded");
columns = 4;
i = 1;
col = 0;
for (counter=1; counter<=this.total; counter++) {
col++;
if (col>columns) {
i++;
col = 1;
}
this.imageName = 'col'+col+'image'+i;
this.imageLoc = this[this.imageName];
_root.createEmptyMovieClip(this.imageName, counter);
_root[this.imageName].loadMovie('http://localhost/'+this.imageLoc);
switch (col) {
case 1 :
_root[this.imageName]._x = 0;
break;
case 2 :
_root[this.imageName]._x = 233;
break;
case 3 :
_root[this.imageName]._x = 466;
break;
case 4 :
_root[this.imageName]._x = 699;
break;
}
if (counter == this.total) {
this.topcol = col;
this.topimage = i;
}
}
} else {
trace("Error loading variables");
}
gotoAndPlay(2);
};
stop();
Frame 2:
PHP Code:
var pauseSeconds:Number = 5;
var fading_speed:Number = 200;
columns = 4;
i = imageinfo.topimage;
col = imageinfo.topcol+1;
function fade(mc, i) {
mc._alpha -= 2;
if (mc._alpha<=0) {
mc._alpha = 0;
clearInterval(nb_fade[i]);
}
}
for (counter=imageinfo.total; counter>=1; counter--) {
col--;
if (col == 0) {
i--;
col = 4;
}
imageName = 'col'+col+'image'+i;
imageLoc = this[this.imageName];
nb_fade[counter] = setInterval(fade, fading_speed, imageLoc, counter);
}
stop();
Right now, all of the images fade at the same time. My main hurdle is that I need to "pause" during the for loop, so that the topmost image will fade, then 5 seconds later the next will fade, and so forth.
Doing them decrementally like that seemed like the easiest way to go, since I'll always be sure which ones are on top. But perhaps I should just put them all in an array in the first frame's loop instead of going through it again? Then perhaps I could use setInterval or something like that? Any help, guidance or advice would be much appreciated.
Multi Sound Loop Mixer Methods. Plea$e Help.
HI, I've been racking my head trying to figure this out for 3 days. I understand the concepts of what I'm asking for but not the language to write the code. And i'm going bonkers trying to figure this out.
Abstract:
I'm trying to build a little sound mixer application with 5 loops and 5 buttons(1 per loop), each respective button will pause and play the loop with a MOUSE_CLICK event, but also have MOUSE_OVER and MOUSE_OUT events attached as well.
The end result will be a flash sound mixer where the user can turn on one, two, three, four or all five loops to create the composition using the loops. It'll look as simple as it sounds, like a 5 key piano where the stripes are buttons to turn up each sound (the roll over event is to sample the loop before user turns it on.
Details:
Here is a brief description of what i need this app to do.
1. Five color stripes across the stage will all have MOUSE_OVER and MOUSE_OUT events to trigger their corresponding sound loop at a reduced volume.
2. Each of these stripes will also have an MOUSE_CLICK event handlers to increase the volume to full, but allow the user to move over to another stripe and add it to the mix -- without triggering the MOUSE_OUT event. OR if the Stripe is already playing it will turn the volume down to off.
3. In addition to the sound I need each strip to play a sequence of images while the sound plays (i can add this to the button mc with no problem).
The problem i see is when a user clicks the first stripe to turn it up all the way, the MOUSE_OUT event should not be triggered when they go to click another stripe I figure that i need to check the volume of that loop in the logic.
What I Have so Far
I started out by setting up EventListeners for the 3 events per button with some logic to check if the music is already playing (see below sample script).
It works ok on the first button (stripe) but when I add another button and script with the 3 handlers (changing custom names & functions so they are unique) things get a little out of hand. I think I need to have some code that cleans up the loops instances so I don't get 4 versions of 'loop1' playing at once (after multiple clicks).
I'm fairly certain I would have to put this in an array to manage the sound loops and check volumes. And it would make or sense to put all that repetitive code into an array. The thing is, I have no idea how to write an array or the volume checker logic.
I've been racking my head trying to figure this out for 3 days. I'm fairly new to AS3 but I understand the concepts of what I'm asking for but not the language to write the code.
If one of you amazing actionscripters could help me out; steer me in the right direction, look at my code below and let me know if i'm on the right track or do i really need an Array. If Array i can't even begin to write that. If you could show me how that's done I think it would help a lot of people out here trying to control sound with AS 3. I'd be willing to even pay one of you to write this array for the 5 buttons. Name your price (i'd post it back here so everyone can learn btw).
Please help this needy designer.
Here is the set up:
STAGE (button stripes with instance names below)
onOff1 / onOff2 / onOff3 / onOff4 / onOff5
SOUND (in same directory as the fla/swf)
loop1.mp3 / loop2.mp3 / loop3.mp3 / loop4.mp3/ loop5.mp3
CODE:
/* event listeners and functions for onOff1 (stripe one).*/
var music1:Sound = new Sound(new URLRequest("loop1.mp3"));
var trans1:SoundTransform = new SoundTransform(1, -1);
var channel1:SoundChannel = music1.play(0, 0, trans1);
var musicOn1:Boolean = false;
onOff1.addEventListener(MouseEvent.CLICK, onOffSound1);
function onOffSound1(e:Event) {
if (musicOn1 == true) {
musicOn1 = false;
trans1.volume=1;
SoundMixer.soundTransform = trans1;
} else {
musicOn1 = true;
trans1.volume=0;
SoundMixer.soundTransform = trans1;
}
}
onOff1.addEventListener(MouseEvent.MOUSE_OVER, Soundup);
function Soundup(e:Event) {
if (musicOn1 == true) {
musicOn1 = false;
trans1.volume=.5;
SoundMixer.soundTransform = trans1;
} else {
musicOn1 = true;
trans1.volume=0;
SoundMixer.soundTransform = trans1;
}
}
onOff1.addEventListener(MouseEvent.MOUSE_OUT, SoundDown);
function SoundDown(e:Event) {
if (musicOn1 == true) {
musicOn1 = false;
trans1.volume=0;
SoundMixer.soundTransform = trans1;
} else {
musicOn1 = true;
trans1.volume=0;
SoundMixer.soundTransform = trans1;
}
}
/* event listeners and function for onOff2 (stripe two).*/
var music2:Sound = new Sound(new URLRequest("loop2.mp3"));
var trans2:SoundTransform = new SoundTransform(1, -1);
var channel2:SoundChannel = music2.play(0, 12, trans2);
var musicOn2:Boolean = false;
onOff2.addEventListener(MouseEvent.CLICK, onOffSound2);
function onOffSound2(e:Event) {
if (musicOn2 == true) {
musicOn2 = false;
trans2.volume=1;
SoundMixer.soundTransform = trans2;
} else {
musicOn2 = true;
trans2.volume=0;
SoundMixer.soundTransform = trans2;
}
}
onOff2.addEventListener(MouseEvent.MOUSE_OVER, Soundup2);
function Soundup2(e:Event) {
if (musicOn2 == true) {
musicOn2 = false;
trans2.volume=.125;
SoundMixer.soundTransform = trans2;
} else {
musicOn2 = true;
trans2.volume=0;
SoundMixer.soundTransform = trans2;
}
}
onOff2.addEventListener(MouseEvent.MOUSE_OUT, SoundDown2);
function SoundDown2(e:Event) {
if (musicOn2 == true) {
musicOn2 = false;
trans2.volume=0;
SoundMixer.soundTransform = trans2;
} else {
musicOn2 = true;
trans2.volume=0;
SoundMixer.soundTransform = trans2;
}
}
/* event listeners and function for onOff3 (stripe three).*/
...
/* event listeners and function for onOff4 (stripe four).*/
...
/* event listeners and function for onOff5 (stripe five).*/
...
Preload Loop
Hi. I'm trying to set a preload loop.
This script resides on Frame2 of my preload mc.
if ("/track1.swf"._framesloaded>="/track1.swf"._totalframes) {
tellTarget ("/track1mc") {
gotoAndPlay ("music");
}
gotoAndStop (3);
} else {
gotoAndPlay (1);
}
Blank Preload Animation Loop
i'm trying to make a simple preloader w/ a looping movie to play during the preload. Unforunately the looping movie doesn't seem to play when loading the movie. the movie will be blank and won't play the loop until the whole movie is loaded. the preload loop is keyed 'til frame 3 then is faded out.
I'm quite confused.
Here's my script:
frame 1:
totalSize = getBytesTotal();
loadSize = getBytesLoaded();
if (loadSize==totalSize())
{
gotoAndPlay(3);
}
frame 2:
gotoAndPlay(1);
Preload Indiv Images With For Loop
hello all,
loading an xml file and looping through to attach movies and set vars. i have 2 vars that are images so i'm trying to use MovieClipLoader() but it only seems to affect the last image in the loop.
basically each movieclip has it's own animation that needs to be visible until the image is loaded...but all animations are remaining visible after their respective images have loaded except the last one...
Code:
for(var i=0; i<numOfItems; i++){
var t = home.attachMovie("item","item"+i,i+1);
t.c_title = nodes[i].childNodes[1].firstChild.nodeValue;
more vars ...etc, etc...
var myLoader = new MovieClipLoader();
var myListener = new Object();
var lod = myLoader.getBytesLoaded();
var tot = myLoader.getBytesTotal();
myListener.onLoadComplete = function(targetMC)
{
t.clock._visible = 0; // anim that runs until photo is loaded
}
myLoader.addListener(myListener);
myLoader.loadClip(nodes[i].childNodes[10].firstChild.nodeValue,t.icon.inner); //loads photo
...more vars...etc, etc...
} //end for loop
never used moviecliploader before so am i just going about wrong or should not be using this method?
thanks
Preload Dynamic Images In Loop
Hi all,
Basically I'm loading a few images in seperate MC's through XML.
Here's the code:
Code:
function loadBigPic(num, slides) {
for (i=0; i<slides; i++) {
var imgHold:MovieClip = _root.createEmptyMovieClip("imgHold"+i, _root.getNextHighestDepth());
imgHold.loadMovie(menu[num][1]+i+".jpg");
var temp:MovieClip = _root.createEmptyMovieClip("tmp"+i, 999);
temp.onEnterFrame = function() {
filesize = imgHold.getBytesTotal();
loaded = imgHold.getBytesLoaded();
trace(this);
progres = Math.round(loaded/filesize*100);
_root.preloader._visible = true;
_root.bar._width = (progres*Stage.width)/100;
if (loaded == filesize && filesize>4) {
_root.preloader._visible = false;
delete this.onEnterFrame;
}
};
}
}
When I trace(this) wich you can see in the onenterframe function I only get the last MC. lets say I'm loading 4 images: 0,1,2 and 3. When I trace it only shows _level0.tmp3 . And I see the last image loaded.
Why is it only showing the last one? what am I doing wrong? is there a way to queue up the images for preload?
grtz,
David
Multi Loaded Vars To Multi MC's...Banging My Head Against The Wall
OK I'm banging my head against the wall because this is probably too simple, and I've been working on too many things lately *L*
OK so I've loaded a bunch of vars... let's say var1, var2, var3...var6 from a txt file.
Now I want to send each var to a MC whit similar names - but1, but2, but3...but6
code:
varsFile.onLoad = function(success:Boolean) {
trace("loaded");
for (i=0;i<=6; i++) {
buttonClip.but[i].htmlText = varsFile.var[i];
}
};
I've tried a bunch of different syntaxes, but can't seem to get it to work... HELP!!!!!! LOL
Thanks!!!!
Creating Multi-buttons To Open Multi-jpegs
I am a newbie to action-script and flash. I have Flash 6.
I am using a template built in flash and there is a sub page that has numerous
buttons with roll-over effects that were pre-built. BUT they don't point to anything yet.
I want the viewer to be able to click on a button and have each one open a different Jpg in a window next to the rows of labeled buttons.
I imagine this is pretty simple...Perhaps you know of a specific tutorial within this flash help site that addresses this?
Or if there are a few things that you can communicate to help me...that would be awesome!
Thank you!
Specifying The FLV In A Multi-channel Multi-title Player
Hello,
I have Flash 8 Pro that I use to publish an Earth Sciences Agency version 5.1 multi-channel multi-title FLV player on my website. The FLV player is populated using an XML playlist. I'm going through the account setup process at Truveo, which is a search engine dedicated to video, that uses an RSS feed to enter your videos into their search engine. I've set up the RSS feed and it validates.
However, a listing of one of my videos in the search results only points to my site as a whole, rather than to the specific FLV file on a specific channel in the FLV player. I suspect that there is some need in the RSS file to specify the FLV video and also fire an event, plus some type of event listener in my SWF to respond with the correct FLV.
In other words, when the search engine(s) return one of my videos in a search list, and provides a hyperlink to my site, how do I make it open the FLV player at that specific video, rather than just open my site as a whole?
Can anyone point me to a tutorial for how to set that up? Is it even possible?
Thanks,
Tom Wood
Edited: 07/13/2008 at 09:35:46 AM by tomwood2
Multi-multi-dimensional Array?
Can you have an array structured like this?
The idea being that'd we'd have a whole bunch of stores with the same data
School[0] = Store's full name
School[1] = Number of store employees
School[1][0] = Employee 1
School[1][0][0] = Janitor (Title)
School[1][0][1] = Employee 1's hire date
School[1][1] = Employee 2
School[1][1][0] = Sales person (Title)
School[1][1][1] = Employee 2's hire date
And on and on and on
[CS3] Multi Level Drop-down Menu. Trouble With The Multi Level Bit
Hi,
I'm creating a multi-level drop down menu for a college project. So far I have 2 main menu items, one of which (products) contains 3 sub menus (line 1, 2 and 3). Line 1 should also have 3 sub menu items (product 1, 2 and 3).
I'm putting the actions for the line1_mc roll over and roll out on the main timeline but it doesn't seem to be working because it is trying to call a movie clip from within another movie clip!
Any ideas would be greatly appreciated!
Preload Madness - Preload Movies Clip In A Movie?
hey people... a brought up this subject here a while back but it didn't really go anywhere... now that this sections seems to be a bit more lively perhaps some of you flashers can help me out... I am going to break this down very simple... I haven’t even storyboarded this so this is an extremely rough draft of the idea
I am building a photo gallery
this gallery has eight images which range from 30k-75k (roughly) so I don't want the user to wait for a full load of 240k-600k
I want to first load the thumbnails for the images... and then begin to preload the first image directly after that... then display it
and then from that point when the user clicks a thumbnail the corresponding full image will preload and then display
basicially this is about preloading a movieclip in a movie... I jsut can't wrap my head this... so I will ask for help before I get too deep.... any input on the basics of this idea would be appreciated
thanx!
Selectively Preload, Preload Rest While Playing
Hello,
I have updated a pre-bought flash template for a photographer. Long story short, the file is now 4M's -mostly from images- and he wants it to load faster. Right now it is all in one swf, no load movies. So the large jpg's are embedded. (I could make them all movies and load them as needed, but am trying to avoid that.)
I would like to know if it is possible to selectively preload. For instance load everything except the large images mc. This way the movie would play its long intro and the viewer would have to go to the thumbnail gallery before getting to the large images gallery. Meanwhile the large images mc could load in the background?
Any thoughts?
The site is here:
www.crphotography.com
Any help is greatly appreciated.
Preload, Finish Preload Anim, And Then Play
Hello!
I have a preloader with a mc that plays while it loads. I want the movie to preload the whole show, then finish playing the section of animation that it is in, and then play the main movie.
For example:
A ball goes from the right corner to the left (section 1) and then reverses back to the right (section 2). While the show loads the ball just goes back and forth. But once loaded, I want the ball mc to finish going to either corner and then _root.gotoAndPlay(5);
I am thinking of something like this (try not to giggle at me):
if (loaded == total) {
_root.ball_mc.gotoAndPlay(until the next frame label);
then
_root.gotoAndPlay(5);
}
This is my preloader code which works great but cuts of my ball mc abruptly:
onClipEvent (load) {
total = _root.getBytesTotal();
}
onClipEvent (enterFrame) {
loaded = _root.getBytesLoaded();
percent = int(loaded/total*100);
text = percent+"%";
gotoAndStop(percent);
if (loaded == total) {
_root.gotoAndPlay(5);
}
}
Thanks so much!
Preload Code Help - Holding Content During Preload
First off, the current code works fine in terms of function but I want to see if someone has a code fix for me. When the preloader starts, I want the current image to "hold" inplace instead of being unloaded from the "container" MC. I want the bar to load, covering up the current image and then when the preload is complete, load the next image in and display it. Does anyone have an idea on how I might rearrange or change the code? I know I have seen this same technique on several web pages, I just havn't been able to figure out how to execute it.
click on btn1 or btn2 to load an image.
Here's the current SWF
http://josephryannasipak.com/test.html
Here's the code:
stop();
bar._visible = false;
my_mc = new MovieClipLoader();
preload = new Object();
my_mc.addListener(preload);
preload.onLoadStart = function(targetMC) {
trace("started loading "+targetMC);
container._visible = false;
bar._visible = true;
}
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {
bar._width = (lBytes/tBytes)*550;
pText.text = "% "+Math.round((lBytes/tBytes)*100);
};
preload.onLoadComplete = function(targetMC) {
container._visible = true;
bar._visible = false;
trace(targetMC+" finished");
};
my_mc.loadClip("sunset.jpg", "container");
btn1.onPress = function () {
my_mc.loadClip("bluest.jpg", "container");
}
btn2.onPress = function () {
my_mc.loadClip("church.jpg", "container");
}
and the FLA file:
http://josephryannasipak.com/test.fla
Preload Scene DOESN'T PRELOAD
ok, so i have this file, full of images, it's huge. i have a preload scene, the actionscript is as follows:
setProperty ("loadBar", _xscale, "((_root.getBytesLoaded() /_root.getBytesTotal() )*100)");
ifFrameLoaded ("Scene 1", "End") {
gotoAndPlay ("Scene 1", "Start");
}
so basically, it SHOULD increase the width of the preload bar as the movies progressively loads, and it SHOULN'T start playing the main scene(Scene1)until the whole scene is finished loading.
It doesn't do this!
i haven't done much actionscripting b4, so any help would be appreciated.
you can see the extremely CRAP movie at: http://www.angelfire.com/ca/adamstuff/paragon3.html
Preload Several Swfs With One Preload.swf
how can i preload several swfs with one preload swf?
i just have a main swf and some loadmovie swfs which are loaded in the main swf and i dont want to preload them with scenes.
An Effect Without Preload & With Preload
I created a simple rotating efect:
1) without preload:
a) result: http://www.freewebtown.com/ihtus/fla...er_cursor.html
b) source: http://www.freewebtown.com/ihtus/fla...ter_cursor.fla
c)square.onEnterFrame=function(){
square._rotation=square._rotation+0.2;
_root.square._x = _root._xmouse;
_root.square._y = _root._ymouse;
_root.txt._x = _root._xmouse+2;
_root.txt._y = _root._ymouse-10;
}
2) with preload:
a) result: http://www.freewebtown.com/ihtus/fla...h_preload.html
b) source: http://www.freewebtown.com/ihtus/fla...th_preload.fla
There is a difference of the quality, for the case with preload I only added some layers and code for preload efect, and the quality of the rotating object becomes lower... , the question is: how to create preload efect without making the quality of the rotation lower?
Thanks!
Preload (PAUSE) And Then Preload Some More
Hey Guys,
I am working on a pretty big project and I am trying to work out a way of having some of the movie load then stopping (to allow other things on the page to load) then starting again.
It will have 4 movies (3 external) and what I want to do is load the first one normal then wait like 2 seconds and load the second one.. etc etc
I just cant think of a way to do this?
Any help?
Cheers guys
How Do I Define The Greatest _x Position Based On A Loop, Assuming I Know The Last Element Of The Loop?
Hello,
This may be complicated,
I've a loop that creates emptyMovieClips
then I use one function to onRollOver _xscale them += 10
Now I want to move another movieClip based on the greatest _x position of my previously _xscaled elements, how do I do that?
example
for (var i = 0; i<my_array.length; i++) {
_root.menu_.createEmptyMovieClip("btn"+i, i+1);
}
//
_root.menu_["btn"+i].onRollOver = function() {
this._xscale += 10;
//
MY_DRAGER._x = HIGHT._x;
}
Can this be done?
Thanks,
I Would Like My Sound Loop To Continously Loop Without Looping Over Itself When I Repeat My Images.
I have a sound loop moving along with my flash images. When the flash images finish and I send it back to frame 1, my sound doubles. How can I play my sound loop once, but allow my images to continously loop.
Is there away to just run one loop of sound, and let the image aspect continue to loop.
I would like my sound loop to continously loop without looping over itself when I repeat my images.
Make One Element Loop Without Making Enitre Movie Loop?
i'm trying to make one element continue looping without making the entire movie loop... here's what i mean..
i have a layer that i've name actions which i've asigned a stop(); to at the end of the animation. but i want the red pulsating dot to continue looping/ animating ... to give you an even better idea, here's the swf file...
http://www.push1.com/roster_art_gal.swf
cheers!
LoadVars In A For Loop Not Executing .load Function Until For Loop Completed?
Ok so I have a simply for loop: ID[i] is a global array
Code:
for (i=0;i<12;i++)
{
var loadInfo:LoadVars = new LoadVars();
loadInfo.onLoad=function(success:Boolean)
{
if (success)
{
trace("whatever:"+loadInfo.myname);
}
else
{
trace("Nope");
}
loadInfo.load(ID[i]+".txt");
}
the problem I'm having is that the function doesn't execute until the for loop completes and then it executes 12 times in a row. Output is 'whatever: undefined' 11 times and then 'whatever: Bobble' (which corresponeds to the last .myname value as it should). Why is this? And how can I fix it? To be continued...
~NH
Loop Inside Loop... Why Doesn't Work Properly?
In order to cause a delay, I have put a loop inside another loop. Here it is:
for (a=1; a<6; a++) {
for (b=1; b<10000; b++) {
}
}
Flash delays to show the page but in the end I just see both variables with the maximun value. The point was to see variable "a" growing with delay. What have I done wrong?
Thank you
Function Inside For Loop; How To Give It Parameters Of The Loop
Hey!
This is the code:
Code:
for (i=0; i<5; i++) {
_root.createEmptyMovieClip("temp"+i, 1+i);
_root["temp"+i].beginFill(0xFF0000, 20 + (20*i));
_root["temp"+i].moveTo(0+(60*i), 0+(67*i));
_root["temp"+i].lineTo(100+(60*i), 0+(61*i));
_root["temp"+i].lineTo(100+(64*i), 100+(65*i));
_root["temp"+i].lineTo(0+(55*i), 100+(80*i));
_root["temp"+i].endFill();
_root["temp"+i].onRelease = function() {
trace("button Number = " +i);
}
}
So I made butttons and assigned each one an onRelease function. But each one needs to have assigned a variabile by the value "i" in the for loop.
When I write it like this the function itself is defined only after I click it and it ofcourse asigns all the buttons the same "i", the last value of "i" in the for loop.
How do I do it so I get first button with variable 1, second with 2,... ?
Thx.
Pausing Execution Of Code In A For Loop Between Each Loop. Howto?
I have a for loop which runs x amount of times and between each loop i'd like to implement a small pause of execution of the code. How would i do that? Can something like that only be done using a timer? If so how would i go about doing that and what things should i import? (Trying to do this in a class) ...
Loop Help: XML Attribute Doesnt Stay On Each Object Of The Loop
Hi, i'm working on a gallery that loads thumbnails from an xml file into 3 columns and when you click on a thumbnail it opens a new window with the fullsized image in.
I have modified code from a gallery tutorial to load the thumbnails from a xml file. They are going in 3 columns at the moment (I don't understand why but they are) but only the last image has a hand cursor when you rollover it, and then when you click on it, it traces "undefined" into the output box.
I have put
Code:
trace(images_arr[i].attributes.fullsize);
just below the bit where it loads the thumbnails and it traces the right path from the xml file for each image.
Can someone help me get it to trace the right path from the xml file when you click on ALL the thumbnails, not just the last one.
Thank you so much in advance!
Code:
function GenerateThumbs() {
images_arr = images_xml.firstChild.childNodes;
gap = 10;
this.createEmptyMovieClip("thumb_mc",100000);
thumb_mc._y = 10;
thumb_mc._x = 10;
for (var i = 0; i<images_arr.length; i++) {
trace('generating thumbs'+i);
this.thumb_mc.createEmptyMovieClip("thumb"+i+"_mc", i);
this.thumb_mc.createEmptyMovieClip("thumb"+i+"_tmp_mc", 300);
this.thumb_mc["thumb"+i+"_mc"]._x = ((i%3)*(67+gap));
this.thumb_mc["thumb"+i+"_mc"]._y = Math.floor(i/3)*(67+gap);
this.thumb_mc["thumb"+i+"_mc"].loadMovie(images_arr[i].attributes.thumb);
this.thumb_mc["thumb"+i+"_tmp_mc"].no = i;
this.thumb_mc["thumb"+i+"_tmp_mc"].onEnterFrame = function() {
var _mc = this._parent["thumb"+this.no+"_mc"];
var l = _mc.getBytesLoaded();
var t = _mc.getBytesTotal();
if ((l>=t) && (t>1) && (_mc._width>1)) {
_mc.onRelease = function() {
trace(images_arr[i].attributes.fullsize);
};
}
};
}
}
var images_xml = new XML();
images_xml.ignoreWhite = true;
images_xml.onLoad = function(success) {
if (success) {
GenerateThumbs();
} else {
trace("Error loading XML file");
}
};
images_xml.load("gallery.xml");
Pausing Execution Of Code In A For Loop Between Each Loop. Howto?
I have a for loop which runs x amount of times and between each loop i'd like to implement a small pause of execution of the code. How would i do that? Can something like that only be done using a timer? If so how would i go about doing that and what things should i import? (Trying to do this in a class)
Though i'm wondering if there's an easier way than timers to be able to do something like that, like C's sleep() function for example.
My Sound Loop Is Repeating Itself Ontop Of Previous Loop
Here is a link to a movie that I am working on:
LINK-
http://blue-title.com/v2/
My client says that when you first start the movie, the loop starts fine but when he clicks on one of the three buttons at the bottom (Home, Florida, Alabama) the initial first loop continues to play and a new loop is beginning to repeat while the first one is still playing.
It works fine for me in Firefox and Safari on a Mac.
Any solutions?
Todd Temple
Movie Clips In For Loop Onlydisplaying In 1st Loop
Hi there! I'm new at this so excuse if I'm being stupid.
I'm creating a game which I'm looping through an array and inside the loop I'm playing clips. The clips display only the first time the loop is being run. Here is the actionscript. PLEASE SOMEONE HELP ME... I'M DESPERATE!!!
code:
on (release) {
var myClips = new Array("Fletter", "Lletter", "Aletter", "Mletter", "Eletter");
var myClipsNewName = new Array("mov2", "mov3", "mov4", "mov5", "mov6");
var myClipsValue = new Array (10, 11, 12, 13, 14);
var cnt = 0;
for (var t = 0; t<4; t++) {
for (var i = 0; i if (cnt == -1) {
cnt = 0;
}
var temp = myClips[cnt];
attachMovie(myClips[cnt],myClipsNewName[cnt], myClipsValue[cnt]);
updateAfterEvent();
trace(myClips[cnt]);
if (i == Total-1) {
myClips.splice(cnt, 1);
myClipsNewName.splice(cnt,1);
myClipsValue.splice(cnt,1);
if (cnt == myClips.length) {
cnt = 0;
}
break;
}
cnt = cnt+1;
if (cnt == myClips.length) {
cnt = 0;
}
}
}
}
edit: jbum added as tags
HELP Multi SWF?
I want to create a main swf that will load several different swf files, for example my main window which will load is blank it will then load say a menu swf file and then another swf file in the same window. How can I do this?
If anyone can post a example file or possible know of a tutorial or post a detailed description of how to do this, I would very much appreciate it.
Thanks in advance for your help, just one last thing I will need the swf to be displayed in a certain area of the main blank swf and other swf files will also be placed in certain places.
Thanks
0rlando
Multi Mc At Once
Hey,
Is it possible to creat a invisible mc with in 2 other invisible mc's and if so would there be any complications. Im trying to do something similar and it gets to the second layer but then doesnt want to load the third inv-mc. Like loading an external swf to a container mc then in that same mc have another external load and then another.
What do ya think.
Cloak
Multi Mc At Once
Hey,
Is it possible to creat a invisible mc with in 2 other invisible mc's and if so would there be any complications. Im trying to do something similar and it gets to the second layer but then doesnt want to load the third inv-mc. Like loading an external swf to a container mc then in that same mc have another external load and then another.
What do ya think.
Cloak
Multi User ?
Hello,
http://www.*****hotel.com
I have lookied into creating something similar with Flash, but little time to mess with it at the moment. I haven't got too far. I started out just learning to create a chat.....
http://caveart.tv/fc/Chatcave.swf
Kind of amateurish, but a working PHP chat with animations and sound.
Then I looked into creating an interactive character chat. The way I have this test set up is the character is controlled by mouse movement and zooms in on mouseover. There is a chat textfield and an auto resizing textfield (based on the amount of text entered by the user(Thx ericlin)).The textfields are not scripted to anything, but could easily be scripted with PHP for a fuctional chat. The problem I am facing is making it all global. How to "add" a character when another person enters the room. I am assuming it is with a system of arrays and something along the lines of the localtoGlobal command. Any ideas on how best to approach this would be appreciated. Would a log in be helpful or necessary to accomplish seperate characters? I have also looked into Flashnexus a bit with little success. I know this will need an xmlSocket connection to achieve multi user functionality. Any suggestions for that? I use windows mellinium OS. I have the "Virtual Cave" incorporated into another movie right now, but I also have a stand alone version. Any thoughts or ideas as to what approach to take to get this further along would be appreciated.
"Virtual Cave" (On the left side of this room, bottom buttons control scroll, mouseover will show the entrance)
http://caveart.tv/kingdom/Flashcave.swf
Regards
~GD~
Multi MC Control...
Hey all,
I am trying to make a preloader for the backgrounds of my content areas on my site. All i want to do is make a bunch of circles(Actually just one MC duplicated) and have them move in patterns around the screen. One of the FK01 banners has this effect and i have seen others. It shouldn'r be too hard but i'm not sure where to start with the math.
Any help is appreciated,
Thanks,
James
Adding Multi Swf's
hi friends,
i'm trying to use 3 stand alone swf's in one flash movie. i
also need to display them on different places. i would be
greatful if someone help.
thanks.
Multi Swf Comms W/ Js Or Other
issue: i am trying to load movies in other swf's on the HTML page. I tried a few thisgs; GetUrl.javascript:
command works on PC but not on mac.
Is there a simpler way to do this? a tut would be helpful.
K!
Multi Animation
I am working on a site on FMX and I was wondering how you can make two animations animate independently. One that loops constantly and the other that just animates for the first couple of frames.
For example I would like to make a fade in and fade out text loop for the whole scene, as well as a circle that passes through the movie. The fade in - fadout text would loop forever while the circle would pass through once. I would like those two animate independently. The problems I have are that those two animations would do their animation then stop. Or it will just repeat it’s self. It would be appreciated if someone would help me on this.
Thanks
Multi Arrays
how yould you initialise a multidimensional array , cos i cant seem to get it to work:-
i have tried myArray=[[],[]];
and myArray=(100,100);
but the arrays need to be global.
Multi Masks
I am trying to duplicate this effect:
http://www.deepblue.com/augustus_smiles/
I want to fade in bits of the picture as in the above movie. What is the best way to achieve this method? Do I make a mask layer for each square and fade it in or?.... What is the best way to mock this effect? I am a noob so details are appreciated! Thanks in advance
Multi Player
Does anyone have or know of a place where I can get a online multi player game like coke music or rune scape for flash wher like you can choose a little character or somthing like that, that I can mod to put on my site www.xtreme-flash.com ?
Multi-part Help Please
Ok, I'm experimenting with making a menu like what is in the attached file (azienda.fla).
Where, when you click on the image, it enlarges,as well as clears the other images off the screen, then when you click again, it goes back to the small version. I guess this was created in an older version of flash, and partly in another language (Italian?). First off, when making my own version on a new .fla, I've been copying and pasting from (azienda) to my new file. Then replacing the picture. I was hoping I could get some help as to how to do this myself, rather than snaking it off of someone else's file.
The other thing is, in (azienda.fla), the movie clip that has the tween in it that makes the picture enlarge, on the last frame, I want to add a scrollbar, like the one I attached-(scrollbar.fla). But when I do this, it disables the function to close movie (make it small again and go back to the main scene). How can I add this scrollbar to the enlarged picture in the last frame of that movie, still use the close button, then dissapear when I click on the picture again?
Lots of questions, I know.
Multi Keypress' ?
I am trying to make a file that the user can press different keys and get different colour background.
So far i have managed to do single letter keypress' i.e. press n to get a light blue background and b for a black background.
But i would like to change the n to the letter bl for (blue) so when the user holds down keys b+l they would get that color.
Is it possible to have two keys to press in a keypress?
This is what i have entered into my movie clip so far.
on (keyPress "n") {
changeColor = new Color("change");
changeColor.setRGB( 0x0066FF);
}
on (keyPress "b") {
changeColor = new Color("change");
changeColor.setRGB( 0x000000);
}
thanks for any help
dan r
|