Adding 2 Sound Fx To A Scene But It Interupts The First Loop
Hi, i am working through one of the tutorials in swish and i have come accross a problem. IN THE TUTORIAL "THIS IS MY MESSAGE" i have added the vector graphics and the initial sound. However i wanted to added a sound effect when the first picture loaded in. When i did this my first sound loop cuts of then startes again when the sound fx is meant to cut in. So i look at sound/actions panel. I loop 88amp3 15 times and then at my first jpeg i loop a sound fx once. But when i play the whole scene my sound fx cuts in through the whole thing. When i go back to the sound panel i find that the setting have changed and the soundfx wants to play 15 times now overiding my initial 88amp3 sound loop. Its just that in future i want to put key sounds along side pics loading in and what not, and im not sure how to co-ordinate this. Anyone know what im doing wrong? Im pretty sure im close but i cant find the solution. Any takers? Regards, Gibbo.
FlashKit > Flash Help > Flash Newbies
Posted on: 10-03-2002, 08:36 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Adding Sound Loop To Movie
hello,
i wanted to add a sound loop to my movie that automatically starts playing. A tutorial on here sais: make a new layer, with the keyframe selected go to modify - frame and there you can do something... but in the modify dropdown there is no such thing as 'frame'. So that didn't help much.
Flash help sais:
With the new sound layer selected, drag the sound from the Library panel onto the Stage. The sound is added to the current layer.
You can place multiple sounds on one layer or on layers containing other objects. However, it is recommended that each sound be placed on a separate layer. Each layer acts as a separate sound channel. The sounds on all layers are combined when you play the SWF file.
In the Timeline, select the first frame that contains the sound file.
Select Window > Properties and click the arrow in the lower right corner to expand the Property inspector.
In the Property inspector, select the sound file from the Sound pop-up menu.
Select an effect option from the Effects pop-up menu:
I drag the sound to the stage from my labrary, but i dond see such options in my properties inspector, and yes i have expanded the window. might be because i am using flash 8 But someone please help me.
tnx, Snuurtje
Adding A Simple Sound Loop
I have a website that sells saw machines. I want to play the sound of a saw when the home page comes up. Any advise of what player to download, what script to use and where to get the swf file for a saw?
Thanks Mike
Sound Plays From Next Scene, While Playing In Current Scene?
i am making an animation, i have about 8 scenes.
for some reason it starts playing the sound from the next scene in the middle of the current scene.
why?? i checked movie explorer and the sound is in another scene. does that sound like a flash bug, or just me? it is a big file, could that be it. please help it is driving me crazy!!!!!
Sound Bleed From Scene To Scene: Newbie Needs Help
im just learning flash mx
i have a simple scene with a background sound looping on a layer continuously.
once that scene is done the next scene loads up with its own back ground sound
my problem is that the first scenes background sound bleeds into the 2nd scene.. and so on..
it does end eventually
but how do i make it stop exactly when that scene is done.??
this must have an easy explanation
please help the newbie
Sound Stop And Resume From Scene To Scene
Hello,
I am trying to take an MP3 sound file and make it stop and resume from one scene to the next. How would I acheive this?? Is there action script that will controll the starting and stoping of sound from one scene to the next? Many thanx...
mindeye
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.
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
Adding Sound Buttons, Cutting Off Prev Sound
Hi - I want to add a few audio narration clips via buttons to this page, inside each section:
http://www.chartscans.com/csalerts.swf
When the movie starts, it autoplays a bg music + narration nonlooped single track.
How can I add say a button that loads/plays an external mp3 And also shuts off the first sound that had started?
any ideas?
thx flash dudes..
Adding Scene Issue
Hi !
I did flash project in one scene. I put preloader in frond of it (in new scene). Preloader works fine, but the code in next scene doesn't work at all!!!!
I didn't find any solution. I tried to paste all frames to new empty movie with two scenes. Script started to work, but gotoAndPlay commands dont work correctly.
Leos
Trouble With Adding A New Scene
Hi,
I have a main scene that begins with a animation. Now when i add a new scene to house a preloader and place it above the main scene and play the movie the preloader works fine but when it plays the next scene everything stops at frame 1. At 1st I thought it was my preloader but i tripled checked it and it was fine, I also just added a blank scene but i get the same problem. Im using flash 8. ne 1 ever get this problem?
thx
Problems Adding Just A Scene
hi guys,
i am getting in pain just adding a second scene to my flash 8 artwork.
...i have finished an intro and now the movie should jump to a second scene using gotoandplay("scene2", 1).
as soon as i add the second new scene from the scene inspector and play the movie, i get a movie that stops playing to the first (i think it's so) frame of first scene....well at the end ...as soon as i add a scene, the movie stops. no code added or removed!!!it's strange!!!
please helppppp
thank
adro
Adding A Link To Scene
Hi,
I am a total beginner in Flash and wanted to know, how to add a link that opens in a new window to a scene?
I found out that on AS2 it was done in a manner similar to:
ActionScript Code:
on (release)
{
getURL("http://www.google.com",_new)
}
or something like that.
Right now I got to this:
ActionScript Code:
Scene.addEventListener(MouseEvent.CLICK,goTo);
function goTo(e:MouseEvent) {
var request:URLRequest = new URLRequest("http://www.google.com/");
navigateToURL(request);
}
But I get an error 1061
Basically I need to add a link to another web page on my banner.
Help please?!
Why Is Scene 1 Playing Sound From Scene 2?
I have a large Fla with lots of layers... anyways, Scene 1 plays a long streaming sound... at the end of it, I put in a "stop();" and the scene waits for the entire movie to load...
The problem is, when the scene gets to "stop();", I hear the two sound effects that are in the NEXT SCENE! Visually, all it shows is Scene 1. It stays there for a while in fact...
Why is it playing the next scene's sounds!?!?!?!?
Scene 2 Scene Sound Problem....
Hi,,this might be a bit hard....
I have two scenes....I want to load or attach a sound in scene one, and then in scene 2 play an flv file with a media componet.... how do I make the sound stop and come back, once the media player has finished....
I tried tones of script.....but no luck!!!! Any ideas?
Adding A Scene Distorts Images
This seems very strange to me, but why would adding a scene to the movie lower the quality of the images I am using. I have images that look fine, but if I just add a scene to the movie the quality goes way down.
Thanks for the help,
Todd
Adding All Instances In A Scene To An Array
I want to instruct actionScript to look at my scene, go though each item on it (e.g. all of the check boxes and radio buttons) and add each of these items that have got an instance name into an array.
I can't think of a simple solution to this. Can anyone help please?
[F8] Adding Text Field In Scene 2
I have a two scene movie
In the second scene i have
Code:
createTextField("word_txt", 2000, 100, 100, 300, 100);
word_txt.multiline = true;
word_txt.wordWrap = true;
word_txt.border=true;
var my_fmt:TextFormat = new TextFormat();
my_fmt.color = 0xFF0000;
my_fmt.underline = true;
word_txt.text = "This is my first test field object text.";
word_txt.setTextFormat(my_fmt);
If I export the whole movie this doesn't work
If I export just the second scene it does work.
What do I need to alter to make it work if I export the whole scene
THanks in advance
Adding All Instances In A Scene To An Array
I want to instruct actionScript to look at my scene, go though each item on it (e.g. all of the check boxes and radio buttons) and add each of these items that have got an instance name into an array.
I can't think of a simple solution to this. Can anyone help please?
Adding Up Score From Movieclip To Scene
Hi, I am doing a quiz game project using flash that is due soon. I am having a bit of problem with adding up score from many movieclips and displaying it on another scene.
Any help is deeply appreciated.Thanks in advance.
Blurry Graphics When Adding A Scene
Hello...i'm new at this forum and here's my first question:
When i add an extra scene to my movie (flash MX 2004) than all my graphics become blurry like a bad jpg. When i delete the scene again, the graphics are perfect.
Is this a bug in flash or am i doing something wrong? The graphics I imported are png or jpg.
I tried some changes with the jpg publishing quality, but that didn't work.
So..anyone with the solution?
Thnx in advance.
Images Look Crappy When Adding Preload-scene
I have an imagesequence that should be exported with the swf in highest quality. Works great on it self and all, no problem whatsoever, UNTIL....
I added a preloader in a scene
Now when I export, the images look all crappy! Almost bitmap-like. I swear I've checked the properties of all images and the export-settings and all that.
Can someone help me with this problem?
Much appreciated,
Mediamonkey
Adding Scene Makes Images Fuzzy
I have a flash movie (flash 5) with imported PNGs for buttons. When I add a new scene (either by duplicating or adding new), the quality of these images plummets, even though I have the publish settings set to 100% jpg quality. As soon as I delete the new scene(s), the quality is restored. Obviously I can't publish a movie with poor quality images (it's like they've been enlarged and then over-sharpened in paintshop pro or similar, except they haven't). Does anyone know if/how I can remedy this? TIA
Help Adding Moviclips/Btns To My Papervision Scene
Please help. I'm new to papervision and AS3. I'm trying to spin a cube with materials and interact with buttons on the cube. I was able to assemble this:
http://www.methodengine.com/clients/...vidboxspin.swf
It shows my cube with my materials. I placed buttons over the box that spin it. I would like those buttons to actually appear and spin on the cube itself.
Can anyone out there point me in the right direction. I was able to add movieClips on the stage, but no in the front cube material.
Here is my code to make this happen:
ActionScript Code:
package {
import flash.display.*;
import flash.filters.*;
import flash.events.*;
// Import Papervision3D
import org.papervision3d.events.InteractiveScene3DEvent;
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.Camera3D;
import org.papervision3d.objects.DisplayObject3D;
import org.papervision3d.materials.*;
import org.papervision3d.utils.virtualmouse.VirtualMouse;
import org.papervision3d.utils.virtualmouse.IVirtualMouseEvent;
import org.papervision3d.utils.*;
import org.papervision3d.objects.*;
import flash.text.TextField;
import flash.utils.*;
public class Main extends MovieClip {
public var mc :MovieClip;
// ___________________________________________________________________ 3D vars
var container:Sprite;
// var scene:Scene3D;
var scene :InteractiveScene3D;
var camera:Camera3D;
var ism:InteractiveSceneManager;
var plane:Plane;
var time:Number;
var tweening:Boolean = false;
var myVidfront:Boolean = true;
var mouse:Mouse3D;
var vMouse:VirtualMouse;
var material:InteractiveMovieMaterial;
public var myVidContainer:MovieClip;
private var frontMaterial:BitmapFileMaterial = new BitmapFileMaterial("images/player2_back.png");
private var backMaterial:InteractiveMovieAssetMaterial = new InteractiveMovieAssetMaterial("flv", true, true);
private var targetrotationY:Number = 0;
var p:Cube = new Cube(new MaterialsList( {
front: frontMaterial,
back: backMaterial,
left: new ColorMaterial( 0x000000),
right: new ColorMaterial( 0x000000),
top: new ColorMaterial( 0x000000),
bottom: new ColorMaterial( 0x000000)
} ), 800, 100, 500, 1, 1, 1);
public function Main() {
init();
time = getTimer();
}
public function init():void {
stage.scaleMode = "noScale";
// add a spin btn
var spin180_btn:PlayVid= new PlayVid();
spin180_btn.x = 500;
spin180_btn.y = 25;
addChild(spin180_btn);
// add another spin btn
var spin360_btn:PlayVid= new PlayVid();
spin360_btn.x = 400;
spin360_btn.y = 25;
addChild(spin360_btn);
init3D();
addEventListener( Event.ENTER_FRAME, loop );
spin180_btn.addEventListener(MouseEvent.CLICK, spin180);
spin360_btn.addEventListener(MouseEvent.CLICK, spin360);
}
// ___________________________________________________________________ Init3D
public function init3D():void {
// Create container sprite and center it in the stage
container = new Sprite();
addChild( container );
container.name = "mainCont";
container.x = 270;
container.y = 200;
// Create scene
scene = new InteractiveScene3D( container );
ism = scene.interactiveSceneManager;
scene.addChild(p);
p.rotationX = 0;
p.rotationZ = 0;
p.rotationY = 0;
p.x = stage.stageWidth / 4;
p.y = -100;
var moreVids_btn:MoreVids = new MoreVids();
moreVids_btn.x = 480;
moreVids_btn.y = -130;
// scene.container.addChildAt(moreVids_btn,1);
moreVids_btn.addEventListener(MouseEvent.CLICK, spin360);
// Create camera
camera = new Camera3D();
camera.zoom = 10;
camera.sort = true;
}
private function spin180(event:Event):void {
tweening = true;
trace(p);
if(myVidfront){
myVidfront = false;
targetrotationY = 180;
}else{
myVidfront = true;
targetrotationY = 0;
}
}
private function spin360(event:Event):void {
tweening = true;
if(myVidfront){
myVidfront = false;
targetrotationY = 360;
}else{
myVidfront = true;
targetrotationY = 0;
}
}
// ___________________________________________________________________ Loop
function loop(event:Event):void {
if (tweening) {
if (p.rotationY <targetrotationY) {
p.rotationY += Math.sqrt(targetrotationY-p.rotationY);
p.rotationY = Math.round(p.rotationY);
} else if (p.rotationY> targetrotationY) {
p.rotationY -= Math.sqrt(p.rotationY-targetrotationY);
p.rotationY = Math.round(p.rotationY);
}
}
scene.renderCamera( this.camera );
}
}
}
Adding New Frames Before Game Scene [mucking Up]
Got a game, asteroids, and it works fine, but when i move the frames along 1 so that i can add an into screen, with high scores and a play button, it throws off all my remove movieClips.
if anyone know as to why, would be great help.
Adding A Loop To This Array
Can anyone help? I want the first image in the sequence to reappear after the last.
(Flash 8)
var NumberOfImages = 13;
var LocationToImages = "places/";
var FileType = ".jpg";
var MyImageWidth = 600;
var MyImageHeight = 511;
var x = 0;
MyImagesHolder._visible = false;
var MyArray = new Array();
var i = 0;
MyArray[i] = LocationToImages+i+FileType;
i++;
}
_global.Next = function() {
MessageDisplay = "";
x = x+1;
if (x<=NumberOfImages) {
loadMovie(MyArray[x], _root.MyImagesHolder);
_root.preloaderloader.gotoAndPlay(2);
} else {
x = NumberOfImages;
trace("No more images available");
}
};
_global.Previous = function() {
MessageDisplay = "";
x = x-1;
if (x>=0) {
loadMovie(MyArray[x], _root.MyImagesHolder);
_root.preloaderloader.gotoAndPlay(2);
} else {
x = 0;
trace("No more images available");
}
};
ButtonNext._visible = false;
ButtonPrev._visible = false;
stop();
[F8] Help Adding An Action To A For Loop
Ive been trying to figure this out for hours and it is driving me crazy. I need to add a different gotoAndPlay action to each instance of 'a'. I can figure out how to add the same gotoAndPlay action to each one but how to I add a different action to each? Any help would be much appreciated.
code:
_global.t_depth = 1;
t_mcs = [t_ele, t_u, t_c, t_a, t_s, t_m, t_o, t_t, t_t2, t_t2b, t_a2];
for (a=0; a<t_mcs.length; a++) {
t_mcs[a].scaleTo(50, 1, "easeOutElastic");
t_mcs[a].onRollOver = function() {
this.scaleTo(100, 0.5, "easeOutElastic");
t_depth += 1;
this.swapDepths(t_depth);
};
t_mcs[a].onRelease = function() {
variable = t_mcs[a];
_root.gotoAndPlay("variable");
};
t_mcs[a].onRollOut = t_mcs[a].onReleaseOutside=function () {
this.scaleTo(50, 1, "easeOutElastic");
};
}
Adding A Loop Delay
Code:
function buttonsUp(items, topic, xvalue) {
numMenuItems = items;
for (i=0; i<numMenuItems; i++) {
duplicateMovieClip("_root.blob", "blob"+i, i);
_root["blob"+i]._y = (460)-(i*_root.blob._height);
_root["blob"+i]._x = xvalue;
_root["blob"+i].text = _root[topic+(i)];
_root["blob"+i].onPress = function() {
trace(topic+this.text);
_root.away();
loadMovieNum("caseStudies.swf", 5);
};
}
}
Is there any way for me to add a delay between each increment in the loop, ie so that the next movie would duplicate a split second later than teh one before for example.
Adding OnEnterFrame To A Loop
I am placing via actionscript an entire grid of squares to fill the screen.
They are placed on stage through a For loop.
I would like each movieClip added to obtain a function (as you would use onClipEvent() if the movie Clip was already on the stage) ..
But as these clips are being dynamically added - how or where would I add the function in the code?
Code:
sw = Stage.width/2;
sh = Stage.height/2;
h = 22;
t = 10;
for(i=0; i< t; i++){
var xPos:Number = i*22;
_root.attachMovie("wave","_mc"+[i],this.getNextHighestDepth(),{_x:sw+xPos,_y:sh}) };
So I would like EACH attached _mc to have an OnEnterFrame Event occurance ... Where could I add the intended function ... ie: this._x = _root._xmouse;
Thanks!!!
Adding Text From XML Using For Loop
Can´t seem to add all the <name>gallery name </name> that I have in my XML.
I only end up adding the one with the last iteration of [l].
Obviously I´m doing something wrong, and I´m not that good with for loops, so I´m really hoping that someone with better knowledge than me can help me out with this!
ActionScript Code:
function loadwork(event:Event):void { workList = xml.item.name; workMenu.defaultTextFormat = myFormat; workMenu.wordWrap = true; workMenu.mouseEnabled = false; for (var l:int=0; l < workList.length(); l++) { workMenu.x = 10; workMenu.y = l * 30 + 240; workMenu.text = workList[l]; } addChild(workMenu); }
That´s how far I´ve come using tutorials, going crazy now
Anyways, thanks in advance to any and all help in this matter!
Regards
/rundevo
Loop Only One Scene
I have 2 scenes in a movie: first scene is the preloader, second scene is the main movie. At the last frame of the movie I have the following actionscript:
"this.gotoAndPlay(1);" but it starts the whole movie along with the preloader scene...
I want to loop only the second scene(main movie), without the preloader!
What actionscript I have to use?
Scene 1 No-loop, Scene 2 Loop
Hi,
I am fairly competent creating animations in flash, but unfortunately I know very little about action scripting. I wish to do something that I think should be really simple.
I'd like my first scene to play once, and then my 2nd scene to loop. If this is an easy thing to explain and someone doesn't mind, I would really appreciate the help.
Thanks so much,
Denise
Loop Scene
hi guy's i would like a code or tutorial to play and loop my scene twice and stop not a movie clip
thanks
Loop Scene
Hello all...
I am just a beginner. I am trying to do a website. I am stuck at a point.
Let me explain.
I have a text which slides in from the left on page load. Now i have other animations like a wheel rotating on the same page. I want to keep the wheel rotating and I would not want the text to slide in at every loop.
I tried action script to go and play on the text layer, from the frame after the slide in, but that affects other animation.
kidnly help. thanks.
Loop Sound ( Sound Class Preloader By Moock)
how can i loop the sound if i use the sound class preloader by collin moock?? here its the code :
ActionScript Code:
Sound.prototype.checkLoadProgress = function() {
var kbLoaded = Math.floor(this.getBytesLoaded()/1024);
var kbTotal = Math.floor(this.getBytesTotal()/1024);
var percentDone = isNaN(Math.floor(kbLoaded/kbTotal*100)) ? 0 : Math.floor(kbLoaded/kbTotal*100);
this.onBytesLoaded(this.getBytesLoaded(), this.getBytesTotal(), kbLoaded, kbTotal, percentDone);
};
Sound.prototype.clearLoadCheck = function() {
if (this.loaderID) {
clearInterval(this.loaderID);
}
};
Sound.prototype.preloadSound = function(url, isStreaming) {
this.clearLoadCheck();
this.loaderID = setInterval(this, "checkLoadProgress", 200);
this.loadSound(url, isStreaming);
};
music = new Sound();
music.onLoad = function(success) {
this.clearLoadCheck();
if (success) {
loadMsg_txt.text = "Done loading.";
} else {
loadMsg_txt.text = "Load failed.";
}
};
music.onBytesLoaded = function(bytesLoaded, bytesTotal, kbLoaded, kbTotal, percentLoaded) {
loadMsg_txt.text = "Loading: "+kbLoaded+" of "+kbTotal+"
"+percentLoaded+" percent complete.";
};
music.preloadSound("song.mp3", true);
thanks in advance
Adding Progressbars To Stage With Loop?
hey everyone...
I have this code
PHP Code:
function xmlLoaded(event:Event):void{ var k:int; var string:String; var captiones:String; xml = XML(event.target.data); xmlList = xml.children(); alen = xmlList.length();ImageURL=xmlList[i].attribute("url");ImageCaption=xmlList[i].attribute("desc");string = "";captiones = "";for(k = 0;k < xmlList.length();k++){////////REFER TO NOTE 1///////////// if(k == xmlList.length() - 1){ string += xmlList[k].attribute("url"); captiones += xmlList[k].attribute("desc"); }else{ string += xmlList[k].attribute("url") + ","; captiones += xmlList[k].attribute("url") + ","; }//////////////////////////////////////}a = string.split(',');a2 = captiones.split(','); init(i);}var p:int; var galleryLength:Number = a.length; // loop through each of the images in the gallery_array. for (p = 0; p<galleryLength; p++) { /* create a movie clip instance which holds the image. We'll also set a variable, thisMC, which is an alias to the movie clip instance. */ var thisLdr:Loader = new Loader(); thisLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, loaderCompleteHandler); thisLdr.load(new URLRequest(a[p]));//.src var thisMC:MovieClip = new MovieClip(); thisMC.x = thisX; thisMC.y = thisY; thisMC.addChild(thisLdr); addChild(thisMC);//////////REFER TO NOTE 2/////////////// pb = new ProgressBar(); pb.move(thisX, thisX + 10); pb.mode = ProgressBarMode.EVENT; pb.source = thisMC; addChild(pb)///////////////////////////////////////////// if (((p + 1) % 6) == 0) { // reset the X and Y positions thisX = 30; thisY += 80; } else { thisX += 50 + 40; } } }
Look at code above and refer to the correct Note below
Note 1: I know that is not the BEST way to go about handling the xml data into an array so if anyone knows a better way to do that please help?
Note 2: See that code loads thumbnails onto the screen and it uses the original image to do so... so loading times greatly vary. I would like a new progress bar for EACH thumbnail to appear ontop of it... Just a small one that shows the progress for that thumbnail. This would be a great help. Even better would be for some one to tell me how I can get ALL their loading sizes into one and just have one progress bar show untill all thumbs are loaded. This displays the all the progress bars but dosn't appear to show them LOADING?
Thanks,
Kriogenic.
Trouble Adding Eventlistener In Loop
I'm having trouble adding this eventlistener in a simple loop. Can somebody tell, why the eventhandler doesn't get triggered?
Code:
// handler
function countryHandler(e:MouseEvent)
{
trace(e.currentTarget.name);
}
// add eventlistener loop
for (var i:Number = 0; i < isoCountriesArr.length; i++)
{
var tempId:String = isoCountriesArr[i];
if (map_mc.getChildByName(tempId) != null)
{
var tempCountryMc:MovieClip = MovieClip(map_mc.getChildByName(tempId));
countryArray.push(tempCountryMc)
tempCountryMc.addEventListener(MouseEvent.CLICK, countryHandler);
}
}
Adding MovieClips To An Array Via For Loop
I have 91 seperate movieclips that make up a maze. I need them to put them in an array, so that I can use the hitTestObject to see if the guy hits the maze. Right now I have the following code, but it doesn't seem to be working.
Code:
var mazeArray:Array = new Array();
for(var i:Number = 1; i<=91; i++)
{
var c:MovieClip = this.getChildByName("maze"+i) as MovieClip;
mazeArray[i] = c;
}
Thanks!
Adding A Time Delay To A For Loop
Could someone help me to put a time delay in the for loop. Here is my code as it is now. i have tried many combinations with setInterval with no luck.
Thanks.
The code:
loadVarsText = new loadVars();
loadVarsText.load("test.txt");
loadVarsText.onLoad = function(success) {
if (success) {
trace("done loading");
scroller.text ="";
var pieces = this.var1.split("
")
for(var t=0;t<=pieces.length;t++){
setInterval(scroller.text = scroller.text + pieces[t], 10000);
trace(t);
}
} else {
trace("not loaded");
}
};
Adding Library Symbols In A For Loop
please mind the confused question, but this used to be very easy to do in AS2.
let's assume that i have 10 symbols in my library called _mc0,_mc1, _mc2......_mc9
and i want to attach them dynamically to the stage
this is what I'm trying to do written in AS2
Code:
for (var i:Number=0; i<10; i++){
this["movieReference_"+i] = _root.attachMovie("_mc"+i , "newMC"+i , _root.getNextHighestDepth() );
}
now, when ported to AS3, the form in which we append the incremented variables to the class name looks weird (and of course it throws error 1007..
this is the version that produces the error:
Code:
for (var i:uint=0; i<10; i++){
var _mc = new this["_mc"+i]();
stage.addChild(_mc)
}
how on earth do you rewrite the phrase var _mc = new _mc1() in a dynamic form?
thanks for the help in advance
Adding/Controlling Delay In A Loop
Is there any way to add a delay within a FOR loop such as:
Code:
for (var i:int=0; i < 10; i++) {
var termSprite:MovieClip = new MovieClip;
addChild(termSprite);
}
So that after the addChild statement there is pause added in before continuing on to the next iteration?
Dynamically Adding Buttons In A Loop
Hi all,
This really has me stumped. I have a loop running based on some XML tags - the AS loops through each instance of a particular value in an XML file. for each instance, I'm attaching a button that needs to display particular information associated with each entry in the XML file. I can get the buttons to appear, and show up in the right places (with _x and _y values defined in the XML file), but I can't get the button functions' to behave properly. Every button attached has the same value when it comes to calling individual functions (the value of the last loaded button). Here's the code I'm using for the entire function:
Code:
function add_brewers(province:String) {
var globalDepth = null;
var brewtxt_xml:XML = new XML();
brewtxt_xml.ignoreWhite = true;
//set the onLoad event handler
brewtxt_xml.onLoad = function(success:Boolean) {
//if the data parsed, extract it
if (success) {
//use XPath to select all article titles into an array
var city_array:Array = XPath.selectNodes(this.firstChild, "/provinces/province[@name='"+province+"']/brewer/name");
//use XPath to select all author names into an array
var loc_x:Array = XPath.selectNodes(this.firstChild, "/provinces/province[@name='"+province+"']/brewer/xloc");
var loc_y:Array = XPath.selectNodes(this.firstChild, "/provinces/province[@name='"+province+"']/brewer/yloc");
var bName:Array = XPath.selectNodes(this.firstChild, "/provinces/province[@name='"+province+"']/brewer/name");
if (globalDepth == null) {
var globalDepth = 100000;
_global.globalDepth = 100000;
_global.setDepth = function() {
return (globalDepth++);
}
}
var text_name:Array = [];
for (var i:Number = 0; i < city_array.length; i++) {
var m = attachMovie("brew_info", "brew_button" + setDepth(), setDepth());
m._x = loc_x[i].firstChild.nodeValue;
m._y = loc_y[i].firstChild.nodeValue;
m.text = city_array[i].firstChild.nodeValue;
m.onRollOver = function(){
info_box._alpha = 100;
}
m.onRollOut = function():Void {
info_box._alpha = 0;
}
text_name.push(m);
var info_box = attachMovie("brew_box", "brew_box" + setDepth(), setDepth());
info_box._x = 500;
info_box._y = 130;
info_box._alpha = 0;
info_box.bName.text = city_array[i].firstChild.nodeValue;
}
}
else {
trace("unable to load XML");
}
}
brewtxt_xml.load("xml/provinces.xml");
}
My main question is this: How can I attach the buttons so that the variable 'm' has a unique value (and therefore shows the proper 'info_box' movie clip when moused-over)?
I'd really appreciate any help in this matter. Thanks!
Creating A Scene Loop
Hello all,
i'm not the best actionscripter in the world and im having problems creating a simple loop!! All i would like to do is play a particular scene 5 times and the move on to the next scene. I just cant seem to get the code right! Any1 care to help'??
Mark Regler
Creating A Scene Loop
Hello all,
i'm not the best actionscripter in the world and im having problems creating a simple loop!! All i would like to do is play a particular scene 5 times and the move on to the next scene. I just cant seem to get the code right! Any1 care to help'??
Mark Regler
Flash MX Scene Loop
Hi all,
I have inherited a flash file created by a fellow worker that I would like to make into a screen saver. I have three different apps that do this, but they all produce 1 annoying problem:
When I am creating the .scr file, even with the box checked to loop the file, when the .scr plays, it doesn't loop.
I thought I could remedy this by just adding a goToAndPlay() at the end of the .swf file and not rely on the screen saver to loop.
However, I am just starting on MX, and cannot get the goToAndPlay() (or play, stop, goToAndStop, etc) to work correctly - it just keeps going (there are a lot of extra frames at the end just to test it) Is there something different about how MX handles these actions than version 5?
We were hoping to have this today, so any help is greatly appreciated.
Making A Scene Loop?
How do I make a single scene loop, like I got loader in one scene and then the picture scene which should loop..
Atm it loops both loader and pics?
see http://www.madsjespersen.dk/testpage.htm
How To Loop Current Scene?
Last edited by Codemonkey : 2006-11-07 at 12:45.
I have the following in a movieclip:
ActionScript Code:
onClipEvent (enterFrame) {
var newLoadVars = new LoadVars();
newLoadVars.load("http://www.voicesyssoft.com");
if (newLoadVars.decode ="show=Agent")
{
gotoAndPlay("Agent", 1);
}
}
I am trying to goto a seperate scene based on the name/values returned. The above will not work. Why?
Thanks, Justin.
Mp3 Sound Loop Bad. Wav Loop Good.
I have a soundloop which is a WAV file
and it works just fine when i loop it in flash
But when i convert it to an MP3 file...for osme weird reason theres a little less than 1 second pause when it starts again...you can tell its a loop...not smooth
But in WAV format its fine.
Its weird..ive used two different softwares to convert my wav file.
ive used Creative Wave Studio, Ive used a dedicated third party MP3-WAV convertor.
same results...the mp3 has bad looping.
any ideas?
|