How Do U Tell A Function To Stop Running?
easy question but i dont know how.
i wanna have this function- fsp ()
be able to run and stop running. how do i do that?
FlashKit > Flash Help > Flash ActionScript
Posted on: 04-04-2007, 06:18 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Stop Function From Running
Last edited by permort : 2007-06-29 at 01:40.
I got this function that I can´t find a way to stop running. I want to stop it and start it later.
ActionScript Code:
var rain = function (raincounter) {
for (i=1; i<=raincounter; i++) {
this.attachMovie("rain", "rain"+i, this.getNextHighestDepth());
}
};
rain(100);
Is there any way to break out of this loop from outside the function?
I have also tried to call it again from another place in the flash with:
rain(0);
but it won´t stop "Raining". Can anybody help, please?
Stop Running The Rest Of This Event Listener/function
How do get the rest of the code in a Event listener to stop running...
ActionScript Code:
function yesClick(event:MouseEvent):void {
currentMC.visible=false;
if (event.target.parent.name=="step_1_mc") {
if ((check_1_On) ||(check_2_On) ||(check_3_On)) {
trace(check_1_On);
step_1_mc.error_mc.visible = false;
step_2_mc.visible=true;
currentMC = step_2_mc;
} else {
step_1_mc.error_mc.visible = true;
// after the above else statement has run
// I want yesClick to stop running
}
thingsIDontwantToRun1.x = 45;
thingsIDontwantToRun2.y = 700;
}
How Do I Stop This Script Running
hey all,
I'm pretty new to Flash and am trying to learn - I found this script which I have been messing around with converting to MX - but it slows everything else down. Is this code still from an older Flash version?
Can anybody help me - how can I stop the script from running continously and sucking processing power?
here it is:
onClipEvent (enterFrame) {
cloudSky._visible = 0;
i = Number(i)+1;
if (Number(i)<180) {
duplicateMovieClip("cloudSky", "cloudSky" add i, i);
}
cloudSky._x = random(100-n/2)-50;
cloudSky._y = Number(random(5))+Number(i*0.88);
cloudSky._xscale = Number(random(10))+Number(i*1.5);
cloudSky._yscale = Number(random(10))+Number(i*1.5);
trace("cloudSky" add i);
}
thanks for any help - pondgirl
Can't Stop Preloader From Running
Hello all, I'm new here. Using flash mx.
I've searched all through the site and can't seem to find an answer to this particular prob.
I have a site with an intro that covers the time it takes for the images in the site to load (56k users) but wanted to have a skip button for people with broadband or who had seen the intro before.
I added a percentage preloader which i connected to the skip button so that someone with the site in their cache or broadband would be able to go straight to the menu but 56k users would have to wait for the images to load if they pressed the skip button.
I only want the preloader to appear if the skip button is pressed. I have tried putting the preloader in it's own scene and skipping it using a gotoandplay but the movie always starts the preloader.
thanks in advance, any help would be appreciated,
rich
Running The Stop(); Sign ?
I am perplexed by the what should be the simplest of tasks.
I have an fla (FlashMX 2004 Pro - WinXP) consisting of three layers in this order:
actions
(c) symbol
Movie
The (c) symbol is a simple grahic that places a copyright symbol over the Movie... which is an imported QT.
I have done 33 different swfs using this same procedure; but for some reason, on this particular one, the movie doesn't stop(); at the actionscript keyframe and always jumps back to the start and sits there.
This has been driving me crazy for over two hours - and as I've never had anything so 'simple' not function as expected I resort to asking if someone can shed some light on this.
I even tried using one of the 33 files that work just fine, replacing the Movie with the intended movie and it still does the same thing.
Thanks - I feel like an idiot but am not to humble to beg.
driver198
Stop Running All Scripts
Hello,
I was wandering if there is anyway to stop all scripts from running?
I use a script to stop all movieclips(nested) playing and that works great.
But in some of my external loaded swf files there are scripted animations.
Is there anyway to stop this? Does anyone have any idea?
How To Stop All Running Timers At Once?
I'm working on a game that has lots of timers in different classes/objects.
Once a player has finished a level i'd like to stop all those timers. There are quite a lot of them, so i was wondering if AS3 has something that can stop and reset them all, instead of stopping/resetting them all 1 by one very specifically on the event of a finished level. (Which could be very complicated to do)
Does anyone know if something like that exists or how that is generally done or if there are any solutions/workarounds to this?
How To Best Stop A Running Video?
I have a basic site that is made up of several layers with some Flash in a few of them. One layer contains a video player that plays an flv file (not embedded). It works well and I have made the typical video controls - play/pause, rewind & stop. When you click 'stop' it will stop the movie and replace the video skin with the original background.
My question: How can I stop the the video when someone navigates to a different layer without clicking 'stop' first? The video layer is now hidden and the proper layer is displayed, but the video is still playing (you can hear it.) What can I do?
If someone needs to see the site I could upload it to a test area.
Thanks for any ideas.
-Bill
Stop Actionscript From Running
hi there,
First of all I have to say that these forums are an amazing help for my flash projects and i got alot of answers to my problems here.
But here's my current problem:
In the project i'm working on i want to make an animation that switches between frames after a certain time.
So when the counter reaches 0, it goes to frame 2 and starts playing that animation. But the actionscript I have in frame 1 keeps running when i'm in frame 2. I've looked everywhere but i couldn't find out how i can stop the actionscript from running.
Any help would be appreciated, i attached the code from my first frame in the post.
Zyrax
p.s Sorry for any grammer / typo's , english is not my native language
ActionScript Code:
aantalLetters = 200;
minSpeed = 1;
maxSpeed = 4;
displayTime = 10;
countDown = function () {
displayTime--;
if (displayTime == 0) {
_root.gotoAndStop(2);
}
};
vliegText = function () {
//this._x += Math.sin(this.spread);
this._x = this.spread;
this._y -= this.speed;
if (this._y<5-Math.random()*50) {
this._y = 420;
this._x = 250;
}
};
for (i=0; i<=aantalLetters; i++) {
var mc = _root.attachMovie('text', 'text'+i, i);
mc.onEnterFrame = vliegText;
mc._alpha = 50+random(50);
mc.spread = i*2.5;
mc.speed = minSpeed+Math.random()*(maxSpeed-minSpeed);
mc.gotoAndStop(random(15)+1);
}
timer = setInterval(countDown, 1000);
stop();
Stop Pause Script Running
Hey everybody,
I found a simple pause script.....
function tapePlay() {
clearInterval(myInterval);
play();
}
myInterval = setInterval(tapePlay, 2000);
---------------------
the script works fine..no problems there..
Here's the problem how can i stop the script...it's keeps on running...I tried everything but noting seems to work..
let say on the first frame i put the script and on the 5th frame the script has to stop....how can i do that?
Any help is appreciated..
THXS...
Marvin
[CS3] [AS2] Code Doesn't Stop Running
This has become frustrating! I'm trying to figure out how to stop code that generates a starfield for the intro sequence. It works where it should, but oddly enough - even using a blank keyframe - It still spills out into the second frame. Stop(); is included in all the frames, but it doesn't make a difference. I tried onEnterFrame();, and that only made it worse - causing the entire thing to start "skipping" as if there were no Stop calls in the code at all.
It should basically stop running in frame two, but doesn't - here is my code thus far, all located in frame one:
Code:
var frame:MovieClip = attachMovie("frame_mc", "frame", 1000000);
for (var i = 0; i<950; i++) {
var nm = "star"+i;
_root.attachMovie("star",nm,i);
_root[nm]._x = Math.random()*750;
_root[nm]._y = Math.random()*400;
_root[nm].distance = Math.random()*200+1;
_root[nm]._xscale = 250/_root[nm].distance;
_root[nm]._yscale = 250/_root[nm].distance;
_root[nm].speed = 50/_root[nm].distance;
_root[nm].onEnterFrame = function() {
this._x += this.speed;
if (this._x>750) {
this._x = 0;
}
};
}
stop();
Trouble Running A Function In A Function...
this is very odd im running a funsction to check passwords against two lists of passwords...
fist list checks fine, but the sceond list fails even if it is equal...
can somone take a look and tell mewhats wrong?
here is the script for a quick look ive also attached the fla in a zip.
Code:
_root.passwords="1234,4567,test";
_root.adminpasswords="admin,admintest,admin123";
var passes:String = _root.passwords;
var passlist:Array = passes.split(",");
function checkPASS(passlogin) {
trace(passlogin);
for (var i = 0; i<passlist.length; i++) {
trace(passlist[i]);
if (passlist[i] == passlogin) {
trace("in");
gotoAndStop("loggedIN");
break;
} else if (passlist[i] != passlogin) {
trace(failedchecks)
trace(passlist.length)
failedchecks = i;
if (failedchecks+1 == passlist.length) {
trace("second list check");
checkADMIN([passlogin]);
break;
}
}}}
var ADMINpasses:String = _root.adminpasswords;
var ADMINpasslist:Array = ADMINpasses.split(",");
function checkADMIN(ADMINlogin) {
trace("second list checking")
trace(ADMINlogin);
for (var i = 0; i<ADMINpasslist.length; i++) {
trace(ADMINpasslist[i]+" = "+ADMINlogin);
if (ADMINpasslist[i] == ADMINlogin) {
gotoAndStop("loggedIN");
break;
} else if (ADMINpasslist[i] != ADMINlogin) {
trace(failedAchecks)
trace(ADMINpasslist.length)
failedAchecks = i;
if (failedAchecks+1== ADMINpasslist.length) {
trace("second not in");
gotoAndStop("badPASS");
break;
}
}}}
How To Stop All Running Movieclip Nested Inside One After The Other.....
hai,
I have a problem with stopping the moving clips in a file. The thing is i have a play button and pause button in the bottom, a song is playing and it contains so many movieclips nested inside, including mouth and lip synchronizsed, but when i give pause button the mouth and lip animation is not stopping, give me suggestion.
Stop All Code Running On Enter Frame
Hi
I have just started trying to write a game using Actionscript 2.0. All is go well except I can not find a way of stopping Actionscript running all functions attached to a frame when entering a frame. I only want the functions to run when a set criteria is met.
I have added the functions at the end of the code and, once the frame is running, they only appear to be called when the criteria is met. However, for some reason when entering the frame, all of the code is executed once, including the functions at the end, even though the criteria has not been met (I have used the 'trace' function to confirm this). I am hoping there is a simple command I can place between the main code and the functions to stop this happening. If only it was as simple as my childhood programming of using 'goto' and 'gosub'.
Thank you.
[CS3, Actionscript 2.0) How To Stop Actions From Running Across Scenes
I'm not even sure that I am putting this in the right place. I originally posted it to the AS3 forum, but when I open a new flash movie, I am choosing 2.0. When I realized that, I posted it here. I apologize if I've posted to the wrong place.
I am using Flash CS3. I'm new at actionscripting and I do not understand it completely. I have a movie that has a few (2-4) scenes in it. Each scene is like its own "commercial" I created a holiday movie that has snowflakes falling using an online tutorial. The movie works fine by itself, but when I load it as a scene in the movie that has my "commercials", the snowflakes continue to fall throughout the rest of the scenes. The holiday movie has a movie clip that has a snowflake falling straight down. The actionscripting duplicates the movie clip randomly as well as its opacity, postition, etc. I understand what I did during the tutorial, but I'm not sure how to get the snowflakes to stop falling throughout the rest of the scenes. I've tried entering a stop after the script but it just seems to stop the scene there without continuing to rotate through the rest of them. I don't quite understand where to tell it to stop. Somewhere else on the actions timeline? In the movie clip itself? Here is the actionscript code I'm using:
this.createEmptyMovieClip("canvas_mc",10);
var i = 0;
myInterval = setInterval(addFlake,500);
function addFlake() {
if (i<20) {
var t:MovieClip = canvas_mc.attachMovie("snowflake","flake"+i,canvas _mc.getNextHighestDepth());
i++;
t._xscale = t._yscale = Math.random()*80+20;
t._x = Math.random()*Stage.width;
t._y = -50;
t._alpha = Math.random()*40+50;
}
}
I hope I've provided enough info. Any help you can provide is greatly appreciated!!!!
Easy Way To Stop Flash 5 Player Running MX SWFs?
Yes, I want to stop Flash 5 player running version 6 SWFs; I thought if you compressed them they'd be unplayable but no.
Why? There are tons of pages I have to sort out where to check player they've put a little version 6 swf which takes you on to the desired URL and if it doesn't kick in, HTML sends you to the player download site.
They thought Flash 5 wouldn't play them, and neither did I.
These little forwarding movies need to be small and simple (so the clients can make them in future, choose the URL themselves).
Any help appreciated.
Stop Actionscript Function At A Specific Frame (stop Looping)
I want to stop an effect at a specific frame but I dunno how.
Do I have to put something in the code?
I'm confused.
Or just tell me how to stop it from looping.
Edit:
Is it possible to attach this to a movie clip? Then i can stop it or use onEnterFrame and then escape();
I actually have no idea what I am talking about. /Edit
Here is one of the code I borrowed:
MovieClip.prototype.placeInSpace = function(id) {
var ratio = this.focaldistance / Math.sqrt(this[id].z * this[id].z);
this[id]._x = this[id].x * ratio;
this[id]._y = this[id].y * ratio;
this[id]._xscale = this[id]._yscale = 1000 / this[id].z;
}
MovieClip.prototype.randomPlace = function(id) {
var radius = this.rmin + (this.rmax - this.rmin) * Math.random();
var polar = 2 * Math.PI * Math.random();
this[id].x = radius * Math.cos(polar);
this[id].y = radius * Math.sin(polar);
this[id].z = this.zmin + (this.zmax - this.zmin) * Math.random();
}
Here's the other code cause I can use two in my movie:
function mover() {
// Move the particle over time
this._y += this.speed;
this._yscale += 10;
this.speed++;
if (this._y>500) {
this._y = 0;
this.speed = Math.random()*10;
this._yscale = 100;
}
}
function starField(x, y, n) {
// Generate a starfield of specified dimensions with n stars
for (var i = 0; i<n; i++) {
var star = this.createEmptyMovieClip("star"+i, i);
var dot = star.createEmptyMovieClip("dot", 0);
star._rotation = Math.random()*360;
star._x = x;
star._y = y;
dot.lineStyle(0, 0xFFFFFF, 100);
dot.moveTo(0, 10);
dot.lineTo(0, 15);
dot.onEnterFrame = mover;
dot.speed = Math.random()*10;
}
}
starField(275, 200, 100);
Function Running
hi, I'm an italian web designer(from Sicily).
I'm can speak little english, sorry
I'm really desperate and iìm risking to be fired , in fact, i have to complete this simulation game about horse-racing within four days.
In this game there are six horses, six Mc running horizzontally inside a Mc named "path"which is almost 3000 pixel long for example.
I have used the random function inn order to simulate the race , but the required mechanism expects the server to decide the arrival chart. I have to make everything "real" ; for example one of th horses might stay back and at a certain point, make up ground and win. I tried to do but i really can't, and i don't know who might be able to help me, i hope ypu will help otherwise..... i don't know what will occur to me
Tahnk you very much
i have a file fla for example:
http://members.xoom.virgilio.it/pepigno75/tryhorse.zip
Why Is Function Running?
Here is what is most probably a dumb question, but my brain has stopped being able to analyze....
Simple function, and then a button that is supposed to call that function. But the function is being called with out the button being clicked.
What is going on?
CODEmcBox._visible = false;
var btOne:Button
function changeColor(){
if (mcBox._visible == true){
mcBox._visible = false;
}
else {
mcBox._visible = true;
}
}
trace (mcBox._visible);
btOne.onRelease = changeColor();
Animated Running Legs Stop After 1 Cycle With Keyboard Event
this code only does 1 cycle of the animation(btw, the KeyMover class moves the movieclip forwards and backwards, there is no issue with that):
Code:
import controls.KeyMover;
var keyMover:KeyMover = new KeyMover(character);
this.stage.addEventListener(KeyboardEvent.KEY_DOWN, pressed);
this.stage.addEventListener(KeyboardEvent.KEY_UP, released);
function pressed(event:KeyboardEvent)
{
character.gotoAndPlay(2);
}
function released(event:KeyboardEvent)
{
character.gotoAndPlay(1);
}
i have the lower half of an animated character made. the first frame of the movieclip is set to stop at normal standing position, the second frame on is animated for one cycle of running and when it hits the last frame it automatically goes back to frame 2 for another cycle and so on. it actually goes a bit further than 1 cycle, which confuses me. i figure that the key to make the animation run is constantly setting off the function so it sorta overrides the code in the animation that makes it cycle over and over, but the fact that it doesn't stop at the end of the first cycle makes that an unconvincing theory. any help would be appreciated.
Stopping A Function From Running
I have a function creating a new clip..
'function makeNewClip(){'
how do i stop the function from running?
//stop button
cow1stop_btn.onRelease=function(){
_root.makeNewClip()=false;
}
basically i want to set makenewclip=null?
Running More Than One Function Simultaneously?
hi i have a need. i have a script on a mc that makes it animate and has functions that tell it where the mouse is, etc.
and i wanted to have several of them, as links on a menu. but it seems like when i test movie, the first one always takes up the whole processor, so that the others functions dont ever even get read. so my question is.. is it possible to run the other functions at the same time? if i "return;" the function that is running, then it wont be detecting the mouse anymore, and thats not really what i want. i want them to all run at the same time. help? ive attached the menu here. the actions are inside menu_mc and then the link_mc's in the actions layer.
thanks!
[f8] Running Several Function Simultaneously
Hi, can any show me how to run more than one function at the same time?
I am trying to run this function:
mask.onEnterFrame = function() {
if (this._currentframe == this._totalframes) {
tear_function();
delete this.onEnterFrame;
}
};
function tear_function():Void {
this.onEnterFrame = function() {
if (this.black_dude._x>-70) {
this.black_dude._x -= 12;
}
};
}
for several movie clips, but its only letting me run one at a time. Do i need some kind of loop?
Let me know please!
Thanks.
Function Running Twice At Same Time?
Hello everybody, I am attempting to make a site draw itself with actionscript courtesy of Jim's Flash Bestiary, which can be found here.
Anyway, to the point:
Is there a way to make multiple instances of this function work at the same time? In other words, I want to have multiple "signatures" drawing themselves each time the frame is entered, instead of just one. I tried to do creative things with the script, but I'm at a loss.
The script:
ActionScript Code:
drawSigEF = function()
{
if (getTimer() - this.t >= this.sig[this.i].t*.5)
{
var px = this.sig[this.i];
if (px.m) this.lineTo(px.x, px.y);
else this.moveTo(px.x, px.y);
if (++this.i >= this.sig.length) delete this.onEnterFrame;
}
}
MovieClip.prototype.drawSig = function(sig, thick, clr)
{
this.clear();
this.lineStyle(thick, clr, 100);
this.i = 0;
this.sig = sig;
this.t = getTimer();
this.onEnterFrame = drawSigEF;
}
// Example script usage (using root)
_root.drawSig(sig, 1, 0xFFFFCC);
// Example of a signature, "sig", (the array of
// points etc that makes the signature or drawing.
sig = [
{m:0,x:196,y:47,t:2009},
{m:1,x:192,y:54,t:2042},
{m:0,x:27.4,y:138.7,t:1968},
{m:1,x:26.6,y:137.9,t:2001},
{m:0,x:0.8,y:564.55,t:34033},
{m:1,x:4,y:571,t:34090},
{m:0,x:118.55,y:31.45,t:46580},
{m:1,x:119.35,y:30.65,t:46614},
{m:0,x:12.9,y:15.3,t:3869},
{m:1,x:15.3,y:27.4,t:3902},
{m:0,x:12.9,y:7.25,t:5496},
{m:1,x:14.5,y:12.9,t:5529},
{m:0,x:12.9,y:9.65,t:6288},
{m:1,x:23.35,y:11.3,t:6321},
{m:0,x:13,y:594.95,t:6816},
{m:1,x:18,y:595.95,t:6850},
{m:0,x:13.7,y:4,t:7413},
{m:1,x:9.65,y:5.65,t:7447},
{m:1,x:138,y:576.95,t:1663}
];
I'd also love to learn a more efficient way of doing this, if there is one out there that exists. I just would love to record my drawing on my graphics tablet, have a flash file "replay" the drawing movements, and have that be the layout of the site. Thanks very much everybody,
-Matt O, AS newb.
Running A Random Function
Hey everyone,
I've searched and.. I think I'm just not quite sure what I'm looking at... so here's what I want to do.
I have these three functions, I want flash to pick one and run it when someone loads the page. I want it to pick a random one, either gozilla, bowie, or mj.
// Fun animation 1
function godzilla()
{
menu_mc.godzilla_master._alpha = 100;
godSound.start();
bow = setInterval(function(){rainbow();clearInterval(bow ); }, 200 );
//timer = setInterval(function(){rainbow(); }, 500 );
}
// Fun animation 2
function mj()
{
menu_mc.mj._alpha = 100;
mjSound.start();
mjoff = setInterval(function(){menu_mc.mj._alpha = 0; }, 3000 );
}
// Fun animation 3
function bowie()
{
menu_mc.car._alpha = 100;
getStage();
new Tween(menu_mc.car, '_x', null, sw + 500, -500, 2, true);
bowieSound.start();
}
Right now I have it so when this function finishes
function finishIntro()
{
fade(intro_ring.welcome, 'out', 5);
menuControl();
// This loads a certain animation to surprise the user
god = setInterval(function(){godzilla();clearInterval(go d); }, 5000 );
}
It sets an interval to call the function godzilla. I want basically to use this function finishIntro, and in that last line.. in 5 seconds call either godzilla, mj, or bowie and I want flash to pick.
How do I do this?
Running Js Function In Html From A Swf.
Hi there,
I've got an html page with a swf inside it. Using a click in the swf, I want a javascript function in the head of the html (which has effects in the html) to run.
Hope that makes sense, any help on how to solve this would be wonderful!
Thanks,
Rebecca
Running A Function In A Hittest Once
I have a mc that slides in when the mouse is over it, using a hittest. heres the code:
ActionScript Code:
onClipEvent (load) {
this._x = 670;
vel = 10
}
onClipEvent (enterFrame) {
if(this.hitTest(_root._xmouse,_root._ymouse,true))
_root.newy = 412;
else
_root.newy = 630;
fukx += (_root.newy-_x)/vel
_x = Math.round(fukx);
}
the reason im not using rollOver is that there are other rollOvers within the mc and 2 in one mc conflict.
i want to execute a function when hittest is detected, instead of using the
ActionScript Code:
fukx += (_root.newy-_x)/vel
_x = Math.round(fukx);
for the movement. so the code would become:
ActionScript Code:
onClipEvent (enterFrame) {
if(this.hitTest(_root._xmouse,_root._ymouse,true))
runThisFunction();
else
runAnotherFunction();
}
the only problem with this is that the code within the function loops indefinately when used with hittest. How can i tell flash to just run the code within the function once?
Thanks!
Running AFTER A Function's Been Executed?
Below is the current code I'm using. It works fine and does what I need it to do, no problems.
However, I'd previously tried to use a conditional statement to have the last two tweens (3x and 4y) to wait until all the previous ones had finished, and have been unsuccessful and been getting a syntax error for onLoad. I don't know how adding a boolean conditional statement (i.e. dLaunchDone = true) gave me a syntax error for onLoad, but it did. Could be my computer's acting funny, but that's wishful thinking.
I'll be okay if it can't be done, just wondering how I get a function to wait until another has been completely executed before running as well.
Attach Code
stop();
//importing tweens
import mx.transitions.Tween;
import mx.transitions.easing.*;
//setting Title to 0 transparency
mcTitle._alpha = 0;
//functions
//slides title down and fades it in
function Launch ():Void
{
//slides title down
var tween1y:Tween = new Tween(this.mcTitle, "_y", Regular.easeOut, this._y, 10, 30, false);
//fades title in
var mcAlpha1:Tween = new Tween(this.mcTitle, "_alpha", Regular.easeOut, 0, 100, 50, false);
//slides blue tab up
var tween2y:Tween = new Tween(this.mcBlueTab, "_Y", Regular.easeOut, 613.0, 135.1, 70, false);
//slides black tab left
var tween1x:Tween = new Tween(this.mcBlackTab, "_x", Regular.easeOut, 551.0, 91.1, 70, false);
//scale the table X
var tween2x:Tween = new Tween(this.mcTable, "_xscale", Regular.easeOut, 0, 100, 70, false);
//scale the table Y
var tween3y:Tween = new Tween(this.mcTable, "_yscale", Regular.easeOut, 0, 100,70, false);
//slide H Grid left
var tween3x:Tween = new Tween(this.mcHGrid, "_x", Regular.easeOut, 629, 90, 70, false);
//slide V Grid down
var tween4y:Tween = new Tween(this.mcVGrid, "_y", Regular.easeOut, -372.1, 134.1, 70, false);
}
//execute on load
onLoad = Launch;
Running A Function From A Child MC?
Hi all
I have a function called menuchange sitting on frame 1 of _root.pt_menu.ptmenumc.menufinal.menuchange
To run this function I would use
_root.pt_menu.ptmenumc.menufinal.menuchange();
Is that correct?
Any help would be great,
Function Not Running In A Class
Hey guys,
I've got a bit of an odd issue. I have a class called UIObject that has a private property called _id. I have a getter/setter for it, and I extend UIObject by a class, lets say, MenuButton. Inside of MenuButton I have this function:
ActionScript Code:
public function create($id:Number):Void { this.id = $id; trace("=====> create"); }
now, I have a Main class that activates my MenuButtons, and that code is here:
ActionScript Code:
private function initMainMenu():Void { for (var i:Number = 0; i < 6; i++) { var ob:Object = new Object(); ob.mc = this.menu_mc["item" + i + "_mc"]; ob.mc.create(i); ob.mc.onRelease = function():Void { trace(this.id); }; } }
I've used this code successfully in the past, but for some reason my past two projects, it has not worked and create never gets run. I've tried time and time again to figure out why this isn't working all of a sudden, but I can't. I imagine i'm missing some very small detail and I need someone to point it out to me. Any help is greatly appreciated. Thanks.
- Matt
Running An Object Through A Function
Hiya,
I have some stored info inside object 's'. Everything works when I run s through my function. s is reference to a movieClip which is what actually runs through the function. However, I want to make this action happen by clicking another MC. Look at the code below and it will be easier to see:
Code:
s.onRelease = unReleased;
What I want is to ignite that line of code exactly, but by releasing a different MC, ie:
Code:
exit_mc.onRelease = s.onRelease = unReleased;
However, I dont want to click s to do so. You see, if I call the function unReleased just via exit_mc, then all the stored vars in s aren't put into action, as they aren't running through the unReleased function.
Make sense? I think it's sheer Syntax difficulties on my part.
Help Please! It's simpler than it seems - I know that!
Not Running Function Properly.
Right this issue is really bugging me.
I am creating a platform game for which i have created an array function for the enemies. If the character lands on the enemies head then it'll die. However if it walks into it left or right then the character dies via the KidDie() function.
I have tried duplicating this array for Spike. I want to have some spikes so that when the character collides with them he'll die. I have set this up and when the character collides with them then it'll run the KidDie() function.
The KidDie() function is set up so that if the character has no lives then its game over, however if he has any lives left then a message will appear in a dialog, once the ok button is clicked it'll reload the level.
Now, this all works and runs fine when the character collides with the enemy, however, when the character collides with the spikes, regardless of how many lives the character has left it goes straight to Game Over. I've been faffing around for an age trying to fix it but can't seem to figure it out.
I have attached all my code for reference, i have highlighted the relevant sections of code...
Code:
///////////////////////////////////////
// RELEVANT CODE IS BELOW THIS POINT //
/////////////////////////////////////
// check collisions with enemies, items
public function checkCollisions() {
//enemies
for(var i:int=enemies.length-1;i>=0;i--) {
if (kid.mc.hitTestObject(enemies[i].mc)) {
// is the kid jumping down onto the enemy?
if (kid.inAir && (kid.dy > 0)) {
enemyDie(i);
playSound(theVirusDie);
} else {
kidDie();
playSound(theFall);
}
}
// spikes
for(var s:int=spikes.length-1;s>=0;s--) {
if (kid.mc.hitTestObject(spikes[s].mc)) {
kidDie();[/color]
}
}
}
//items
for(i=otherObjects.length-1;i>=0;i--) {
if (kid.mc.hitTestObject(otherObjects[i])) {
getObject(i);
}
}
}
// remove enemy
public function enemyDie(enemyNum:int) {
var pb:PointBurst = new PointBurst(gamelevel,"Virus Removed",enemies[enemyNum].mc.x,enemies[enemyNum].mc.y-20);
gamelevel.removeChild(enemies[enemyNum].mc);
enemies.splice(enemyNum,1);
}
//enemy got player
public function kidDie() {
// show dialog box
var dialog:Dialog = new Dialog();
dialog.x = 375;
dialog.y = 250;
addChild(dialog);
if (playerLives == 0) {
gameMode = "gameover";
dialog.message.text = ".:: Game Over ::.";
} else {
gameMode = "dead";
dialog.message.text = "Infected by Virus";
playerLives--;
}
kid.mc.gotoAndPlay("die");
playSound(theFall);
}
// player collides with objects
public function getObject(objectNum:int) {
// award points for treasure
if (otherObjects[objectNum] is Binary1) {
var pb:PointBurst = new PointBurst(gamelevel,100,otherObjects[objectNum].x,otherObjects[objectNum].y);
playSound(theBinarySound);
gamelevel.removeChild(otherObjects[objectNum]);
otherObjects.splice(objectNum,1);
addScore(100);
} else if (otherObjects[objectNum] is Binary0) {
pb = new PointBurst(gamelevel,500,otherObjects[objectNum].x,otherObjects[objectNum].y);
gamelevel.removeChild(otherObjects[objectNum]);
playSound(theBinarySound);
otherObjects.splice(objectNum,1);
addScore(500);
} else if (otherObjects[objectNum] is heart) {
pb = new PointBurst(gamelevel,"Extra Life",otherObjects[objectNum].x,otherObjects[objectNum].y);
gamelevel.removeChild(otherObjects[objectNum]);
playSound(theNewLife);
otherObjects.splice(objectNum,1);
playerLives++;
livesDisplay.text = String(playerLives);
// got the key, add to inventory
} else if (otherObjects[objectNum] is Key) {
pb = new PointBurst(gamelevel,"Password Obtained" ,otherObjects[objectNum].x,otherObjects[objectNum].y);
playerObjects.push("Key");
playSound(theBigBinary);
gamelevel.removeChild(otherObjects[objectNum]);
otherObjects.splice(objectNum,1);
// got the key, add to inventory
} else if (otherObjects[objectNum] is KeyTwo) {
pb = new PointBurst(gamelevel,"Password Obtained" ,otherObjects[objectNum].x,otherObjects[objectNum].y);
playerObjects.push("KeyTwo");
playSound(theBigBinary);
gamelevel.removeChild(otherObjects[objectNum]);
otherObjects.splice(objectNum,1);
} else if (otherObjects[objectNum] is Laptop2) {
if (playerObjects.indexOf("KeyTwo") == -1) return;
if (otherObjects[objectNum].currentFrame == 1) {
otherObjects[objectNum].gotoAndPlay("open");
playSound(theComplete);
levelComplete();
}
// hit the door, end level if hero has the key
} else if (otherObjects[objectNum] is Laptop) {
if (playerObjects.indexOf("Key") == -1) return;
if (otherObjects[objectNum].currentFrame == 1) {
otherObjects[objectNum].gotoAndPlay("open");
playSound(theComplete);
levelComplete();
}
// got the chest, game won
} else if (otherObjects[objectNum] is Chest) {
otherObjects[objectNum].gotoAndStop("open");
gameComplete();
}
}
// add points to score
public function addScore(numPoints:int) {
gameScore += numPoints;
scoreDisplay.text = String(gameScore);
livesDisplay.text = String(playerLives);
}
// update player lives
public function showLives() {
livesDisplay.text = String(playerLives);
}
public function showClock(event:Event) {
//milliseconds passed
var timePassed:int = getTimer()-startTime;
//computer minutes and seconds
var seconds:int = Math.floor(timePassed/1000);
var minutes:int = Math.floor(seconds/60);
seconds -= minutes*60;
//convert clock to string
var timeString:String = minutes+":"+String(seconds+100).substr(1,2);
//show in text field
timeDisplay.text = timeString;
}
// level over, bring up dialog
public function levelComplete() {
gameMode = "done";
var dialog:Dialog = new Dialog();
dialog.x = 375;
dialog.y = 250;
addChild(dialog);
dialog.message.text = "Stage Passed";
dialog.time.text = "Time Taken : "+timeDisplay.text+"
";
}
// game over, bring up dialog
public function gameComplete() {
gameMode = "GAME OVER";
var dialog:Dialog = new Dialog();
dialog.x = 375;
dialog.y = 250;
addChild(dialog);
dialog.message.text = "You Got the Treasure!";
}
// dialog button clicked
public function clickDialogButton(event:MouseEvent) {
removeChild(MovieClip(event.currentTarget.parent));
// new life, restart, or go to next level
if (gameMode == "dead") {
// reset kid
showLives();
kid.mc.x = kid.startx;
kid.mc.y = kid.starty;
gameMode = "play";
} else if (gameMode == "gameover") {
cleanUp();
gotoAndStop("start");
} else if (gameMode == "done") {
cleanUp();
nextFrame();
}
// give stage back the keyboard focus
stage.focus = stage;
}
public function playSound(soundObject:Object) {
var channel:SoundChannel = soundObject.play(0);
}
// clean up game
public function cleanUp() {
removeChild(gamelevel);
this.removeEventListener(Event.ENTER_FRAME,gameLoop);
stage.removeEventListener(KeyboardEvent.KEY_DOWN,keyDownFunction);
stage.removeEventListener(KeyboardEvent.KEY_UP,keyUpFunction);
}
}
}
As you can see i have set the spikes up in a loop within the checkCollisions() function.
The relevant code is just under half way under the heading // RELEVANT CODE IS BELOW THIS POINT //.
I by no means expect anyone to read through all the code but i thought it would help to post it all. I have highlights the two functions of note.
Any help whatsoever would be welcome. Its really bugging me as everything works fine and debugs correctly but it just goes straight to gameover even if the character has lives.
Thanks again
Kindest Regards
Tom
Having Problems With AttachMovie Function While Running
Hi,
I'm trying to make flash read values from a text file and draw some graph out of them but I want it to do it step by step. If I make it draw it all at once there is no problem, but it doesn't seem to be working when I try to make it attachMovie during the animation. I'd like to create a loop by wich it would read two values of an array of 2 numbers inside a much larger array and assign this variables to de _x and _y coordinate. Do I have to change something from the linkeage of the symbol?
Thanks a lot.
Function Running Automatically On Swf Load
I have some actionscript:
Code:
this.menuSelect.b3.dynTextHolder.dynText.text = "OTHER";
this.menuSelect.b3.dynTextHolder.onRelease = Vidd("other");
function Vidd(whichVideo) {
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
videoHolder.theVideo.attachVideo(ns);
ns.play("tm"+whichVideo+".flv");
trace ("function exec also "+whichVideo);
}
ok, now when the flash movie loads, the trace in the function is automatically run when the flash clip loads, and doesn't execute again. Even when I click on b3. It's quite simple code, I can't figure out why it isnt running only when b3 is released.
b3 is a button with an .AS file attached to it so that the object knows how to animate when I drag out an instance. Would that make a difference?
Thanks!
Running A Function Upon Song Completion
I'm working on a project that plays random song tracks. Right now it just randomly plays a track and then stops. Is there any way for Flash to start the next song after one song completes.
Here is the script I have so far. BTW, a couple people on this forum helped me with this. They were a HUGE help with helping me understand how this works.
Code:
var songs:Array = new Array("music/track0.mp3", "music/track1.mp3", "music/track2.mp3", "music/track3.mp3", "music/track4.mp3", "music/track5.mp3", "music/track6.mp3", "music/track7.mp3", "music/track8.mp3", "music/track9.mp3", "music/track10.mp3", "music/track11.mp3");
var songPlayed:Array = new Array();
function randomSong() {
var randomNumber = random(songs.length);
var notinList = true;
for (i=0; i<songPlayed.length; i++) {
if (songPlayed[i] == randomNumber) {
notinList = false;
}
}
if (notinList) {
songPlayed.push(randomNumber);
playSong(randomNumber);
} else if (songPlayed.length == songs.length) {
songPlayed = new Array();
randomSong();
} else {
randomSong();
}
}
function playSong(randomNumber) {
track = new Sound();
track.loadSound(songs[randomNumber], true);
track.onSoundComplete = function() {
randomSong();
if (_root.soundOff_mc._currentframe=2) {
track.setVolume(0);
}
};
}
randomSong();
Running Function Of A Loaded Movie
Hello all,
I've got a parent movie that's loading external swf's into 7 container movieclips using the loadMovie() function. That's all good. I need to, however, have external images loaded into additional container movieclips INSIDE those swf's upon them being completely loaded into the parent movie. I know how to reference a movieclip loaded into a level, but if you're loading an swf into a container movieclip, how do you attribute an instance name to it for later referencing? It seems to me that loadMovie() doesn't have this quality.
Insight?
Running Function In External As. Files
Hello, I have two external as. files.
this function is in Photo.as
ActionScript Code:
function getTagsAsStrings():Array
{
var returnTags:Array = [];
for(var id:String in _tags) {
var t:Tag = _tags[id].tag;
returnTags.push(t.value);
}
return returnTags;
}
and I wish to run it in this .as file and have the results put into an array of variables..
ActionScript Code:
import com.kelvinluck.util.LogWrapper;
import com.kelvinluck.flashr.core.FlashrResponse;
import com.dynamicflash.utils.Delegate;
import com.kelvinluck.flashr.core.ResultsSet;
import com.kelvinluck.flashr.core.Photo;
import com.kelvinluck.flashr.core.Flashr;
//import com.kelvinluck.flashr.core.Tag;
class com.kelvinluck.flashr.example.FlashrSimpleSearch extends MovieClip
{
public static var NUM_RESULTS:Number = 1;
private var _flashr:Flashr;
private var _flashrResponse:FlashrResponse;
private var _searchio:Photo;
private var _numResults:Number;
private var _photos:Array;
// these fields are just for debugging
var out:TextField;
var scrollDown:Button;
var scrollUp:Button;
/**
* Function: FlashrSimpleSearch
* Constructor
**/
function FlashrSimpleSearch()
{
// uncomment the following lines if you want to see the internals of what is happening with Flashr.
LogWrapper.getInstance().init();
LogWrapper.getInstance().addTracePublisher();
//LogWrapper.getLog().setLevel(Level.ERROR);
_photos = [];
_flashr = Flashr.getFlashr();
_flashr.apiKey = "b40e05adf210ad4c4cc4da00f99f4184";
_flashr.cacheQueries = true;
_flashrResponse = new FlashrResponse();
_flashrResponse.onPhotosSearch = Delegate.create(this, onPhotosSearch);
_flashrResponse.onPhotosGetInfo = Delegate.create(this, onPhotosGetInfo);
// initialise our debugging scroll buttons
scrollDown.onRelease = Delegate.create(this, onScrollDown);
scrollUp.onRelease = Delegate.create(this, onScrollUp);
}
function doSearch(tags:String)
{
log("Searching for " + NUM_RESULTS + " photos matching tag '" + tags + "'");
_flashr.photosSearch({tags:tags, per_page:NUM_RESULTS});
}
function onPhotosSearch(rs:ResultsSet)
{
_numResults = rs.photos.length;
log("Loading " + _numResults + " photos out of possible " + rs.total + "");
for (var i:Number=0; i<_numResults; i++) {
var thisPhoto:Photo = rs.photos[i];
_flashr.photosGetInfo(thisPhoto.id, thisPhoto.secret);
//easypeasy = _searchio.getTagsAsStrings(thisPhoto);
//trace (easypeasy);
}
}
function onPhotosGetInfo(photo:Photo)
{
_photos.push(photo);
if (_photos.length == _numResults) {
onAllPhotosLoaded();
}
}
function onAllPhotosLoaded()
{
for (var i:Number=0; i<_photos.length; i++)
{
// put all the photos into a variable each loop
var thisPhoto:Photo = _photos[i];
// y co-ord
var nY:Number=110;
// x co-ord
var nX:Number;
// stolen from some old code, basically setting the spacing between each picture, it increases the
//spacing as the loop increments
nX = 25 + (_photos.length * 10) + (i * 78);
// create a movieclip to load the photos into
var mc:MovieClip = _root.createEmptyMovieClip("photo"+i, i);
mc.createEmptyMovieClip("img", 1);
// and load the image into it
mc.img.loadMovie(thisPhoto.thumbnailUrl);
mc.photo = thisPhoto;
// position the images using our co-ords
mc._x = nX;
mc._y = nY;
// open photo page when photo clicked
mc.onPress = function()
{
getURL(this["photo"].photoPageUrl, "_blank");
};
}
}
// the following functions are just used for the textfield we are tracing into...
function log(m:String)
{
trace(m);
out.text += m + newline;
out.scroll = out.maxscroll;
}
function onScrollDown()
{
out.scroll += 1;
}
function onScrollUp()
{
out.scroll -= 1;
}
/**
* Function: toString
**/
public function toString():String
{
return "[com.kelvinluck.flashr.example.FlashrSimpleSearch]";
}
}
im not too sure how to do it,
any help would be greatly appreciated! you guys were a great help last night!
Update Of Display While Function Is Running
I have a function where I run the following code:
ActionScript Code:
// Update database
admin_status.text = "Here we go - lets get started with "+ arr_sql.length +" queries!";
var db = new database();
for (var i = 0; i < arr_sql.length; i++) {
db.query(arr_sql[i]);
trace(i +"/"+ arr_sql.length +" completed...");
admin_status.text = i +"/"+ arr_sql.length +" completed...";
if (i >= 200) {
break;
}
}
admin_status.text = "Database updated.";
It runs many SQL queries and then for each query I want to update a TextField that I have named admin_status. So I set the text property for each loop but the only thing I ever see is "Database updated" when it's all done (but I see the traces). Why is that? Is the display only updated after a function has finished?
I guess I have to make asynchronous database queries instead?
Allan
FPS Speed Problem When Running A Function
Hello All,
I have encountered something very strange in my programming. I have a many functions in this program I'm creating. one I will concentrate on.
My program is loading in external files (SWF's) into a holder in another movieclip (well deep). - The loading is fine, work flawlessly.
Next, after all of these SWF's have loaded into thier repective MovieClips, I run another function and delete the one that called it.
This is fine...still working.
This function aligns all the movieclips just loaded into Columns and rows. Here is where my problem begins. I have done this code many a time before, and have seen no problems, I'm running at 32 FPS, and it always seems to screw up the alignment in some way, it does work sometimes, but not all the time (which is what I need)
My question is, then, should the speed (FPS) of the movie actually affect how the code works? If I drop the FPS down to 12, it the screwups happens less often, and if I drop down to 5 FPS it works fine...but the loading takes a while and makes things really choppy (as I woudl expect from a lower FPS).
Does anyone have a solution to this? or an idea on why the FPS affects what the code is doing?
Baffled.
Running A Function In A Parent At The End Of A Child.swf
question: How do I call a function that is inside a parent.swf from a child external swf (class Loader)?
In my menu.swf, there is a child (Loader class) of a content.swf that gets loaded below it on run. Then when a button is clicked, it makes a string that contains the name of the content file to load next, then initiates an ending function on the child, which does some outro animation.
function buttonClick(event:MouseEvent):void
{
nextContent = event.target.name + ".swf";
MovieClip(newContent.contentLoaderInfo.content).endSequence();
}
------------------------------------------
after the ending sequence has executed in the ccontent.swf I need to know how to make a call to a function back in the menu.swf so that I can load the nextContent
Running A Function Multiple Times
I have posted this question in several different ways and looked all over, but I still don"t know...
I have a function that creates an object(I've run into this problem while creating movieclips and sounds) I only want one of this object to exist. So when the function is called again I want it to remove the previous object. Does that make sense, I don;t know if this is a coding question or if I need to understand something about how the compiler works or what, but any advise or links would be appreciated.
Possible To Disable Key Input While Running Function?
Building a FlashLite 1.1 app for my phone and just wondering if anyone has been successful with this? I'd like to temporarily disable the phone's keypad while the the script is processing the input it just got.
i.e. You press a key. It stops listening to the keyboard while it calculates the results. It displays the results and starts listening again for input.
Cheers!
Running A Function From An Imported Class
Code:
class class1 {
public var mc:MovieClip;
public function configUI() {
setX();
setY();
}
private function setX() {
mc._x = 10;
}
private function setY() {
mc._y = 10;
}
}
Code:
import class1;
class class2 extends MovieClip {
private function onLoad():Void {
configUI();
}
}
the interfaceInitiate class returns an error:
There is no method with the name 'configUI'
Can anyone tell me why this might be happening[/code]
[F8] Running A Function When Rolling Over An Attached Movieclip
Ok
What i am trying to get done is when i rollover a attached movieclip, code runs.
My code is below, i bolded what I thought would work, but its not, nothing comes up in the output box
Thanks alot
//begin to make navigation for user to use
_root.createEmptyMovieClip("navContainer", this.getNextHighestDepth());
//fill navContainer with the navigation images
for(var i =0; i<totalNodes;i++)
{
var clipSeparator =35;
navContainer.attachMovie("navImageClip","nav"+i , i , {_x:i* clipSeparator,_y:0});
navContainer["nav"+i].loadMovie(rootNode[i].attributes.thumbnailLocation);
navContainer["nav"+i].onRollOver = function ()
{
trace(this._name);
};
}
SetInterval-called Function Keeps Running; ClearInterval No Help
I have spent ALL DAY trying to figure out what is going wrong here.
I have an empty movie clip which loads a movie clip (a photo border)
from the library, that movie clip in turn loads an external image.
I wrote actionscript which rotates the empty movie clip + movie clip +
external image in from the right edge of the compiled .swf. Then I want it to pause for a few seconds, then rotate out off the right edge, then rotate back in with a new external image.
What happens is the first image loads, it rotates in as expected,
pauses, then rotates out of view. The second image loads, rotates in,
then immediately rotates out. It does not pause.
I figured out that clearInterval was not actually clearing the
interval, so the rotate out function keeps running. I actually had to
alter the rotate out function's 'if' statement, because what it had
been doing previously is rotating out the first movie clip, then the
second movie clip would just sit there at the edge stuttering because
there was a conditional statement telling it to rotate in, while the
setInterval function was still running and telling it to rotate out.
Can someone please PLEASE tell me what is going wrong here?
Code:
onClipEvent (load) {
var randomNum:Number = Math.random();
var stopValue:Number = Math.round((randomNum * 35) - 18);
_rotation = -179;
var rotateUp:Boolean = false;
var ind:Number = 0;
var loaded:Boolean = false;
}
onClipEvent (enterFrame) {
if (_rotation == -179 && rotateUp == false && loaded == false) {
clearInterval(ID);
if (ind != 5) {
ind++;
}
else {
ind = 1;
}
var MC:String = 'pic'+String(ind)+'MC';
attachMovie(MC,MC,10,{_x:120,_y:90});
loaded = true;
trace ('MC is '+MC);
}
if (rotateUp == false) {
trace('rotateUp is '+rotateUp);
_rotation+=1;
trace(_rotation);
if (_x < -95) {
_x += 0.5;
}
if (_rotation >= stopValue) {
rotateUp = true;
}
}
if (rotateUp == true) {
rewind = function() {
clearInterval(ID);
if (_rotation > -179 && rotateUp == true) {
_rotation -= 1;
if (_x >= -200) {
_x -= 0.75;
}
}
}
ID = setInterval(rewind,5000);
if (_rotation == -179) {
clearInterval(ID);
rotateUp = false;
removeMovieClip(MC);
loaded = false;
randomNum = Math.random();
stopValue = Math.round((randomNum * 35) - 18);
}
}
}
as you can see, I've stuck clearInterval() just about everywhere
because it seems like that's the problem... the interval is not
getting cleared, so the function called by setInterval just keeps
running.
Code:
if (_rotation > -179 && rotateUp == true)
this is the 'if' conditional where I added an additional condition to prevent the above- referenced stuttering. But this still is not giving me the pause that I want before the movie clip rotates out again.
Thanks in advance.
Quick Function Running Order Question
Hi there,
Justa quickie to check tht my understanding on functins and how they are called is correct.. For my high score board i have two functions..
AddScore() and ShowScores()
On Frame 3 of my mc i want to add the players score and thn show all the high scores with this new value.. If i call the function from the timeline as such:
AddScore('Anthony','12');
ShowScores();
Will flash process all of addscore() before starting ShowScores() or does the speed of the program interfere with this order.. If so how can i make sure that AddScore() has completed before ShowScore() runs
Hope this makes sense
Ant
Running A Function On A Dynamically Generated Field
Hello,
I'm having trouble with some dynamically generated textareas. They have external content that needs to be formatted as it goes in. I'm trying to get a function to run that will do this but no matter where I put it it doesn't want to work.
Your help would be most appreciated.
Thank you,
Beatie
Attach Code
//Text area format function to suck out extra spaces
var contentLoader:LoadVars = new LoadVars();
contentLoader.onData = function(content:String) {
if (content != undefined) {
_global.introTextArea.text = content.split("
").join("
");
_global.Instr1TextArea.text = content.split("
").join("
");
_global.Instr2TextArea.text = content.split("
").join("
");
_global.Instr3TextArea.text = content.split("
").join("
");
_global.Instr4TextArea.text = content.split("
").join("
");
_global.Trig1TextArea.text = content.split("
").join("
");
_global.Trig2TextArea.text = content.split("
").join("
");
_global.Trig3TextArea.text = content.split("
").join("
");
_global.Trig4TextArea.text = content.split("
").join("
");
_global.Act1TextArea.text = content.split("
").join("
");
_global.Act2TextArea.text = content.split("
").join("
");
_global.Act3TextArea.text = content.split("
").join("
");
_global.Act4TextArea.text = content.split("
").join("
");
}
};
//run the function
contentLoader.load("content/introduction.xml", "content/instructions01.xml", "content/instructions02.xml", "content/instructions03.xml", "content/instructions04.xml", "content/trigger01.xml", "content/trigger02.xml", "content/trigger03.xml", "content/trigger04.xml", "content/activity01.xml", "content/activity02.xml", "content/activity03.xml", "content/activity04.xml");
|