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




Can't Control Whether Flash Loads My Variables Or Not



So I have a movie that loads a text file of variables every time it hits Frame 1. This text file is being written to by a user every X seconds, and so I wrote code to make Flash detect when there has been a change in the text file. Once it detects a change, it draws a colored movie clip on the screen. Click here to download my code.

Too much theory? So here's what I'm doing. This thing is a "Schedule Builder" for college students (half Flash, half PHP). A user searches for a class to take (PHP). The user chooses which time to take the class (PHP). PHP sends Flash this class time, and Flash shows the class on the Flash-based schedule. Click here to see the actual application.

The problem? Sometimes everything works fine. Flash loads the variables and immediately adds the class when a user adds it. Other times, Flash just doesn't reload the variables and you can't add any classes. Other times, you can't add the first 3 classes you try to add, and then you can randomly add the 4th.

I haven't been able to figure out the problem. I'm thinking it might have something to do with the cache? Sometimes closing the window and opening a new one works, but other times it doesn't. It's hard to find a pattern here Anybody have any advice? Thanks for reading, MW



FlashKit > Flash Help > Flash MX
Posted on: 04-24-2005, 07:48 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Flash Loads Txt Variables When It Wants?
Greetings,

I'm not sure what the problem is, but here's what's happening: I load some variables from a txt file and expect the fields to be filled; only sometimes it does, sometimes it doesn't. I have another website that works with the same principla, and I get no errors - I think. The txt file is like this:


Code:
&containerMC.daTextBox=<font face="Verdana,Arial"><font size="6"><br><b>We’re back…</b><br><br>Após um período de grandes dificuldades, parece que o projecto Cosmos retornou meus amigos. Mais maduro e forte do que nunca.<br>Ainda assim, gostaria de poder garantir este retorno das cinzas a 100 %25 – mas convém não esquecer que sofri, em pouco tempo, uma catadupa de contrariedades e dezenas de desilusões inesperadas; ninguém me pode levar a mal que eu esteja preocupado e, como tal, preparado para a eventualidade de uma outra situação deste tipo surgir, vinda do nada, sem ser convidada (se bem que a posição do Cosmos, neste momento, é 100 vezes mais segura do que a anterior - virtualmente instalado).<br><br>Gostava de agradecer especialmente a 3 ou 4 pessoas (elas certamente sabem a quem me refiro) por todo o apoio que deram ao projecto e às restantes que participaram na votação que pus à consideração dos utilizadores do site; mas mantenho 800 e tal tomadas de posição na memória que ignoraram o projecto e a sua continuidade – enquanto on-line, tudo esteve bem; quando as coisas apertaram, desapareceram com a agilidade e rapidez animal sob o pressentimento de um fogo próximo. <br>Apesar de 90 %25 das pessoas terem votado pelo pagamento de uma subscrição mensal ao Cosmos, não irei exigi-la – continuo a crer que o conhecimento deve ser gratuito, livre e aberto, de forma a facultar novos horizontes, preencher lacunas que custam dezenas de euros em livros e software, etc. Mas aceitarei, de bom grado, donativos para ajuda das despesas mensais do Cosmos. Eis os dados que já tão bem conhece:<br><br><b>Nome:</b> Rui Miguel Ribeiro de Sousa Fernandes<br><b>NIB - Número de Identificação Bancária:</b><br>0007 0406 00164040018 84 ( Portugal )<br><b>IBAN - Número Internacional de Conta Bancária:</b><br>PT50 0007 0406 0016 4040 0188 4 (International )<br><br>Veremos se conseguirei manter a balança equilibrada, entre os livros do conhecimento e as moedas de ouro – mas as dividas financeiras acumuladas não desapareceram e estão presentes, todos os dias, nos telefonemas e cartas que recebo; não tirei, pois, um coelho da cartola... A par das despesas normais do site, procuro financiamento para a formação de uma Associação, o "Nuevo Millennium", que irá tutelar o Cosmos e o conhecido site filantrópico SOS %26 AID (em sos-aid.com).<br><br>O que vê, é um esquiço do futuro design do Cosmos em Flash. Achei por bem inovar a imagem – ainda assim haverá muitas partes em simples HTML pela funcionalidade, rapidez, versatilidade e simplificação nos cálculos de astronomia. Mas haverá uma tentativa de conjugar um melhor design com as partes técnicas do site. Espero que esteja do seu agrado.<br>Dia após dia, a partir de hoje, pequenas diferenças irão surgir; os aplicativos têm de ser reformulados e irão ser introduzidos um a um até retornarmos ao estado original, mas para melhor. Iremos enveredar mais pelo Universo, pela sua observação, pela sua mecânica e mistérios…<br><br>Embarque, uma vez mais, na nossa caravela galáctica…<br><br>Melhores cumprimentos,<br><br>Rui Miguel Fernandes <br><br>&&textloaded=OK&
The first frames have:


Code:
Scene 1
Action Layer
frame 1
actions for frame 1
System.useCodepage = true;
loadVariablesNum("intro.txt",0);
//LoadVars("intro.txt", "");
frame 2
actions for frame 2
loadedbytes = getBytesLoaded();
totalbytes = getBytesTotal();
loadedkbytes = Math.ceil(loadedbytes / 1024);
totalkbytes = Math.ceil(totalbytes / 1024);
totloaded = int(loadedbytes / (totalbytes / 100));
orbitMC.percent = totloaded + "% loaded...";
if (loadedbytes == totalbytes)
{
if (/:textloaded == "OK")
{
System.useCodepage = true;
loadVariablesNum("intro.txt",0);
orbitMC.percent = "";
//gotoAndStop(5);
gotoAndPlay(4);
} // end if
} // end if
frame 3
actions for frame 3
gotoAndPlay(2);
Layer 16
frame 1
actions for frame 1
loadMovie("track_sound.swf", StingMC);
Sting, <StingMC>
frame 4
actions for frame 4
if (StingMC.loaded == false){
gotoAndPlay(1);
} else {
gotoAndStop(5);
}
Sting, <StingMC>
frame 5
Sting, <StingMC>
And, as for the buttons, I have:


Code:
Layer 38
frame 1
frame 5
Symbol 336
actions for Symbol 336
on (press)
{
System.useCodepage = true;
containerMC.daTextBox = "";
loadVariablesNum("home.txt", 0);
titleMC.Title1 = "HOME";
titleMC.Title2 = "HOME";
titleMC.gotoAndPlay(2);
}
Can someone help me out?

Kind regards,

rigel_kent

Flash Loads Variables When It Wants?
Greetings,

I'm not sure what the problem is, but here's what's happening: I load some variables from a txt file and expect the fields to be filled; only sometimes it does, sometimes it doesn't. I have another website that works with the same principle, and I get no errors - I think. The txt file is like this:


Code:
&containerMC.daTextBox=<font face="Verdana,Arial"><font size="6"><br><b>We’re back…</b><br><br>Após um período de grandes dificuldades, parece que o projecto Cosmos retornou meus amigos. Mais maduro e forte do que nunca.<br>Ainda assim, gostaria de poder garantir este retorno das cinzas a 100 %25 – mas convém não esquecer que sofri, em pouco tempo, uma catadupa de contrariedades e dezenas de desilusões inesperadas; ninguém me pode levar a mal que eu esteja preocupado e, como tal, preparado para a eventualidade de uma outra situação deste tipo surgir, vinda do nada, sem ser convidada (se bem que a posição do Cosmos, neste momento, é 100 vezes mais segura do que a anterior - virtualmente instalado).<br><br>Gostava de agradecer especialmente a 3 ou 4 pessoas (elas certamente sabem a quem me refiro) por todo o apoio que deram ao projecto e às restantes que participaram na votação que pus à consideração dos utilizadores do site; mas mantenho 800 e tal tomadas de posição na memória que ignoraram o projecto e a sua continuidade – enquanto on-line, tudo esteve bem; quando as coisas apertaram, desapareceram com a agilidade e rapidez animal sob o pressentimento de um fogo próximo. <br>Apesar de 90 %25 das pessoas terem votado pelo pagamento de uma subscrição mensal ao Cosmos, não irei exigi-la – continuo a crer que o conhecimento deve ser gratuito, livre e aberto, de forma a facultar novos horizontes, preencher lacunas que custam dezenas de euros em livros e software, etc. Mas aceitarei, de bom grado, donativos para ajuda das despesas mensais do Cosmos. Eis os dados que já tão bem conhece:<br><br><b>Nome:</b> Rui Miguel Ribeiro de Sousa Fernandes<br><b>NIB - Número de Identificação Bancária:</b><br>0007 0406 00164040018 84 ( Portugal )<br><b>IBAN - Número Internacional de Conta Bancária:</b><br>PT50 0007 0406 0016 4040 0188 4 (International )<br><br>Veremos se conseguirei manter a balança equilibrada, entre os livros do conhecimento e as moedas de ouro – mas as dividas financeiras acumuladas não desapareceram e estão presentes, todos os dias, nos telefonemas e cartas que recebo; não tirei, pois, um coelho da cartola... A par das despesas normais do site, procuro financiamento para a formação de uma Associação, o "Nuevo Millennium", que irá tutelar o Cosmos e o conhecido site filantrópico SOS %26 AID (em sos-aid.com).<br><br>O que vê, é um esquiço do futuro design do Cosmos em Flash. Achei por bem inovar a imagem – ainda assim haverá muitas partes em simples HTML pela funcionalidade, rapidez, versatilidade e simplificação nos cálculos de astronomia. Mas haverá uma tentativa de conjugar um melhor design com as partes técnicas do site. Espero que esteja do seu agrado.<br>Dia após dia, a partir de hoje, pequenas diferenças irão surgir; os aplicativos têm de ser reformulados e irão ser introduzidos um a um até retornarmos ao estado original, mas para melhor. Iremos enveredar mais pelo Universo, pela sua observação, pela sua mecânica e mistérios…<br><br>Embarque, uma vez mais, na nossa caravela galáctica…<br><br>Melhores cumprimentos,<br><br>Rui Miguel Fernandes <br><br>&&textloaded=OK&
The first frames have:


Code:
Scene 1
Action Layer
frame 1
actions for frame 1
System.useCodepage = true;
loadVariablesNum("intro.txt",0);
//LoadVars("intro.txt", "");
frame 2
actions for frame 2
loadedbytes = getBytesLoaded();
totalbytes = getBytesTotal();
loadedkbytes = Math.ceil(loadedbytes / 1024);
totalkbytes = Math.ceil(totalbytes / 1024);
totloaded = int(loadedbytes / (totalbytes / 100));
orbitMC.percent = totloaded + "% loaded...";
if (loadedbytes == totalbytes)
{
if (/:textloaded == "OK")
{
System.useCodepage = true;
loadVariablesNum("intro.txt",0);
orbitMC.percent = "";
//gotoAndStop(5);
gotoAndPlay(4);
} // end if
} // end if
frame 3
actions for frame 3
gotoAndPlay(2);
Layer 16
frame 1
actions for frame 1
loadMovie("track_sound.swf", StingMC);
Sting, <StingMC>
frame 4
actions for frame 4
if (StingMC.loaded == false){
gotoAndPlay(1);
} else {
gotoAndStop(5);
}
Sting, <StingMC>
frame 5
Sting, <StingMC>
And, as for the buttons, I have:


Code:
Layer 38
frame 1
frame 5
Symbol 336
actions for Symbol 336
on (press)
{
System.useCodepage = true;
containerMC.daTextBox = "";
loadVariablesNum("home.txt", 0);
titleMC.Title1 = "HOME";
titleMC.Title2 = "HOME";
titleMC.gotoAndPlay(2);
}
Can someone help me out?

Kind regards,

kepler

Flash Loads Variables Only SOMETIMES?
For example:
http://www.buckyjohnson.com/news.html

The centre black section displays text loaded from news.php, but it doesn't always work. That is, sometimes it displays no text in the black section, and sometimes it does. It's just a simple loadVars loading text into a textbox. Nothing complex.

Take a look at the PHP file:
http://www.buckyjohnson.com/news.php

Client says is sometimes works, sometimes doesn't. I've had this problem on other projects, but I never bothered to find a solution.

Help?

Thanks in advance!

Flash Loads XML Variables From Cache Memory...
Hi everyone. This is a very important issue. I have been in many many forums looking for this answer and no one fulfills my expectations. As I said on title... I have created a small application that edits my XML file in server. It really works, because I open manually my file and it's perfectly modified... however, everytime I refresh my page it loads the ancient XML variables because they come from cache...

I also could find out that this problem is mainly happening with IExplorer, not with Mozilla Firefox.... however, I need it to run on IE too... but can not find a real solution.. I have been told to add random numbers to the XMl file extenskion, and other things like that, honestly... they do not work... please... does anybody have the light on this issue ??? I will appreciate your answers...

Thanks in advance,

Control When A Swf Loads
Hi,
 
I've created a flash movie that loads a new swf after the current swf plays through.  However, i'd like for the new swfs to load say... 30 seconds after the current one finishes, rather than immediately.
  
Rather than adding a long set of frames to each swf, I'm assuming there is a better way with actionscript to control when a swf loads.
 
Any suggestions?
Jen

Sound Control Loads Into Main Movie Incorrectly,
Hi all,
I have a sound controll a.s. in which I changed the direction of the glide to suite my site. When played as a fla, it works fine, when loaded to the main movie, in a mc, the loaded movie does not directly load into the mc, and the controller glide jumps out of place. I am a beginner, so if you can explain in lay terms that would be spelndid. MX in Windows. Thanks.
start_btn.onRelease = function() {
myMusic = new Sound();
myMusic.attachSound("ChopinWalz.mp3");
myMusic.start(0,100);
};
slider.onPress = function() {
startDrag(this, true, _root.groove._x+100, _root.groove._y, _root.groove._x, _root.groove._y);
};
slider.onRelease = function() {
stopDrag();
};
slider.onMouseMove = function() {
myPoint = new Object();
myPoint.x = this._x;
myPoint.y = this._y;
_root.groove.globalToLocal(myPoint);
_root.myMusic.setVolume(-1*myPoint.y);
updateAfterEvent();

};
stop_btn.onRelease = function(){
myMusic.stop()
;
}

How To Control Flash Variables From Html Url?
How to control flash variables from html url?

For example I saw this
... src="flvplayer.swf?file=nonstopnosound.flv" ...

What is it, and how to use such a things... ?

How Do I Control Variables From ComboBox Values In Flash MX?
I've created a ComboBox using Flash MX's new ComboBox component...I have 3 values:

Jaguar
Porshe
Lamborgini

When the user clicks on say, Porshe, I have a movie clip with 3 labeled sectioned each containing text and an image of each of the cars. There is an instance of this movie clip on my root stage along with the ComboBox. The mc instance name is "cars." When the user clicks on the "Porshe" value in the ComboBox, how and where do I insert code so that an action is triggered that will make the instance of "cars" gotoAndStop at the frames labeled "Porshe" in the cars_mc?

How Do I Create A Loop That Loads Variables Into An Array?
Hello everyone,

It's been a while since I've been on the site due to change of job, house, etc but I hope you are all well.

Got a wee problem for you. I am trying to load co-ordinates into an array in Flash MX. I can't seem to get it to work. What am I doing wrong? ( I think it is something to do with object definition)

Here's my code:

Code:
xcords = newArray();
for (i=1;i<=100;i++){
increment = 231/100;
toAddOn = (i*increment);
xcords[i] = toAddOn;
trace (xcords[i]);
}
I'm really out of practise with my programming and it's really frustrating trying to remember!!

Help please,
Cheers
Graeme

Flash8: Passing Variables When A Movie Clip Loads
I have a function set up on the main timeline of a movie. As the user passes through the various movie clips in the Flash piece, I am passing variables to the function which forwards them to an external web page. This functionality has worked in previous situations where the function was "triggered" by a mouse event (i.e onRelease). I am trying to get this same functionality to work when a movie clip(s) are loaded.

The code I am using at the (movie clip level) is:

onload=function () {
_root.sendVars("variablename","variablevalue");
}

I have tried various iterations with this code both within the move clip itself, and attached to the clip but no luck...

Any clues??

TIA

- Shawn

External Movie Loads, But The Dynamic Text That Loads With It Won't Render HTML?
I have a set of SWFs that load when a button is pressed on the parent SWF file...they all load into an empty placeholder, and each contains it own dynamic text field. the problem i'm having is, the text loads, but the HTML won't render, so i get plain text and html tags

the script in my external SWF files is as follow.


var lv = new LoadVars;
lv._parent = this;
lv.onLoad=function(success){
if(success)this._parent.home.text = this.guide;
}

lv.load("guide.txt");


everything is filled out correctly in the Property menu, someone PLEASE help

2 QUESTIONS: 1)get Internet Browser 2)htmltext Loads After Image Loads
1) is it possible to check whether the user is using internet explorer, or firefox, opera, etc. /retrieve the browser info?

2) how can i tell a text to load once it's html text has loaded. as in if it had an image tag in the htmlText, and i want the text to size itself [_width = textWidth] but it will do it too early, and i need it to function when the htmlText is loaded.

EDIT: i made a button to go to the second frame when clicked, and the second frame would resize the text. so i clicked it once the image loaded. however the text still went to like 1x1. so it doesnt register an image as text..obviously..soo..how could i make it size itself to the image.

Load Movie By Number 1.swf Loads 2.swf Loads 3.swf
hey everybody,

i have a main movie in which i load an externel "1.swf". i've got plenty of swf's to load (2.swf, 3.swf, 4.swf and so on) how can i make a link in 1.swf which automatically loads 2.swf.

i don't want to specify load 2.swf - i want it to load mynumber+1.swf (i think you get the idea). so that i don't have to make every link. i want 1 code for all.

thanks for helping me out on this one

Control Variables From MC?
Hi!

I have a MC named "qTest" that contains 5 buttons (A-E), each when clicked declares a variable. For example, button A in question 7 contains:

on (release) {
answer7 = a7;
}

Button B contains:

on (release) {
answer7 = b7;
}

...and so on. When any of these buttons are clicked, the user must click the submit button to get feedback on their selections (there are 7 questions in total). I also use a tester to see if they've made a selection before submitting their feedback, and if not, display an error. The submit code is:

// check if selection is made: proceed if true, show error if not
on (release) {
if (answer7 == a7 || answer7 == b7 || answer7 == c7 || answer7 == d7 || answer7 == e7) {
// go to frame that displays the feedback window
gotoAndStop ("feedback");
}
tellTarget ("feedbackMC") {
gotoAndStop (1);
response = "Good job, blah blah blah";
}
}
else {
// display warning animation
tellTarget ("warning") {
gotoAndPlay (2);
}
}

This setup works perfectly. One thing, however: I'd like to take the submit button and put it into its own MC so I can make it fadein/fadeout on the qTest timeline. How do I alter the above code so that it can check for & display variables submitted from the qTest MC? I thought it might be something like:

// check if selection is made: proceed if true, show error if not
on (release) {
if (_root.qTest.answer7 == a7 || _root.qTest.answer7 == b7 || _root.qTest.answer7 == c7 || _root.qTest.answer7 == d7 || _root.qTest.answer7 == e7) {
tellTarget ("/qTest") {
gotoAndStop ("feedback");
}
tellTarget ("/qTest/feedbackMC") {
gotoAndStop (1);
_root.qTest.feedbackMC.response = "Good job, blah blah blah";
_root.qTest.answer7;
}
}
else {
tellTarget ("/qTest/warning") {
gotoAndPlay (2);
}
}
}

... but it didn't work. Any ideas?

Thanks for any insight!!
Scott

Control Another Swf Variables?
Hey guys

Just wondering if I can control 1 swfs "_root." variables from another on an HTML page?

Maybe using frames or something?

Any help would be great!!

Cheers!!

[FMX] Using Variables To Control Mc
hello everyone!
i have a question about tutorial about variables in flashkit
http://www.flashkit.com/tutorials/Ac...-770/index.php

my question is:

i want the first instanse of: clip1 will play when clip1 Enter the Frame , without waiting for button1 pressed... can be this done , ?

thanks alot , tom

[FMX] Using Variables To Control Mc
hello everyone!
i have a question about tutorial about variables in flashkit
http://www.flashkit.com/tutorials/Ac...-770/index.php

my question is:

i want the first instanse of: clip1 will play when clip1 Enter the Frame , without waiting for button1 pressed... can be this done , ?

thanks alot , tom

Control MC's With Variables. I Gone Shoot Myself..
Control MC's with Variables. I gone shoot myself..

Please somebody tell me the very simple way that how can i control MC's(inside movement) with a very simple way using varibales.

Control Movie By Variables
hi all!
i want to control a movieclip with a button. now the movieclip (antwort1) has another movieclip in it (a1). my button is placed one layer above the movieclip (antwort1).
movieclip a1 has three frames, each with stop action, on the second frame i set a variable: behave = false, on the third frame, i got: behave = true
this is the movieclip i want to control with my button on which i got following script:

on (rollOver) {
antwort1.a1.GotoAndStop(2);
}
on (release) {
antwort1.a1.GotoAndStop(3);
}
on (rollOut) {
if (antwort1.a1.behave = true) {
antwort1.a1.GotoAndStop(3);
}
if (antwort1.a1.behave = false) {
antwort1.a1.GotoAndStop(1);
}
}

i set the variables to check wether the user clicked or not.
by click it should go to frame 3; if not clicked, it should go to frame 1.
i think my bug is how i want to attach my variables?!
any help would be great
cheerio

Control Mc With Loaded Variables?
Hi

I have a site where i have 18 mc, which build the background of a text field
in one area of the site you can define the bgcolor of the mc with buttons. Theses simply say:
on (release) {
bg1 = "1";
tellTarget ("_root.bg1") {
gotoAndStop(1);
}
}
2nd button says:

on (release) {
bg1 = "5";
tellTarget ("_root.bg1") {
gotoAndStop(5);
}
}

Using Variables To Control Movies
I thought I knew how to use variables to control how a movie will act, however it seems that I don't. Here is the issue. I have an MC off the main movie. In this movie clip I have serveral buttons. here is a layout that I have.

parent MC
child MC
frame 1 call variable
frame 2 button(on release), goto nextframe
frame 3 button(on release), goto frame 4 (this is off a radio
button that works)
frame 3 button(on release), goto frame 5 (this is off a radio
button that works)
frame 4 set variable
frame 4 button(on release), goto frame 7
frame 5 set variable
frame 5 button(on release), goto next frame
frame 6 button(on release), goto next frame
frame 7 button(on release), if variable=frame 4 goto framelable"",
if variable=frame 5 goto different framelable""

In frame 3 I have a button that works, and depending on what is selected, depends on where it goes. I have variables called localy in the MC that are used in the same MC. I have varified no typo's. I have tryed recreating the buttons, but to no success. What happens is it calls the variable in frame 1. In frame 3 I have 2 options, depending on what you pick depends if you goto frame 4 or frame 5. In frame 4 it sets a variable (originaly called in frame 1) when you are finnished here, it shoots you over to frame 7. In frame 5 it sets a variable (originaly called in frame 1) when you finnish it sends you to frame 6, then frame 7. On frame 7 depending on what the variable is (originaly called in frame 1) depends on what happens when you click on the button. So I have everything setup in the button state here. Basicly its...

on (release) {
if (variable="frame4") {
prevFrame();
}
if (variable="frame5") {
gotoandstop "framelable";
}
}

any ideas what I'm doing wrong here?

Sparkyfire

Variables And Symbol Control.
I'm having a problem working off of a variable. The FLA is set up like so:

Scene 1 > menutl > menutlsub1 > tween 10 > (there are three buttons inside of this tween)

and

Scene 1 > bggs > (muliple movie clips, labeled button1, button2, and so on)

The problem lies in the "bggs" movie clip. In that clip I have 6 layers, each containing one of the formentioned movie clips (layer 1 contains "button1", layer 2 conatains "button2", etc).

In each clip there are 30 frames. The first 15 have a graphic Alpha in, the last 15 have it alpha out. There are stop actions at frames one and fifteen, and a gotoAndStop action at frame 30.

The first of the three buttons in the "tween 10" clip tells _root.bggs.button1 to play(), so that clicked once the movie clip alphas in, and clicked again it alphas out.

This system works ok, but obviously when the first button is clicked once, the clip in that layer of "bggs" covers up every other clip when another button is clicked (the "button*" clips take up the whole stage".

To remedy this problem I thought to use "bggsvar" as my variable (which i set to 0 in the first frame of the main scene) and If statements as button actions like this:

code: on (release) {
if (_root.bggsvar != 0) {
_root.bggs["button"+bggsvar].gotoAndPlay(15);
_root.bggs.button1.play();
setVariable(_root.bggsvar,1);
}
else {
_root.bggs.button1.play();
setVariable(_root.bggsvar,1);
}
}

To me it seems that if bggsvar is equal to 2, then the if statement tells _root.bggs.button2 to gotoAndPlay frame 15.

There must be some mistake in my code or syntax somewhere, any ideas?

Thanks for any help in advance,

James

Variables To Control Movie
i am trying to use variables to control where a movie plays from. i want a row of 4 buttons, each one to set a variable named destination to either 1,2,3, or 4. then i want an if statement to make the movie go to frame 1 if destination=1, 2 if destination=2, etc

this sounds easy, but its just not working for me. can someone help me out by posting some easy if loops?

Sound Control Variables?
Yoyoyo

I've rebuilt an old Marantz ghetto blaster in flash and am plannning on using it for soundControl in my site. Volume, balance and the tuner are all controlled by turnable dials and I'm giving the user a myriad of loops to choose from - the script is waaay more complicated than I expected, but it's working well so far...

//so far

I'd be chuffed if I could get the eq to work though. All the research I've done so far hasn't led me to a working model of anything that doesn't depend on having different versions of the same loop which are loaded when the eq controls are changed. Even with 3 loops, and 3 settings for bass, mid and high, I'd need to have like 81 loops to preload.

//No dice

Does anyone know if there are any obscure variables set into Flash than can be used to manipulate sound quality??

K$

ps - going to have to send you kittsters a copy when finished to atone for my raping and pillaging of your loops section!

--
insert clever signature here

Problems Using Variables To Control A Mc
I've trying to perform an specific action when a movie clip is in a frame to do this I've tryed to use var x;
x=0;

on frame 1 inside the mc
and
var x;
x=10;
on frame 10;

in the main time line I have a button with this ActScr

if (x>=10) {
myMc.play();
} else {
MyMc.stop();
}

but it doesn't works. can anyone helpme with this i'm novice with the MX ActionScript

Movieclip Control And Variables
Hi,

I have two Movieclips in my movie: "MarcelBase" and "PeterVocals" (these are the instance-names).

Before i get into frame 76, i make a variable:

var membername:String = "Marcel";

Then i let the movie go to frame 76. Then I have the two movieclips on my screen and the variable is "Marcel". This i what I want:

When you click on one of the movieclips it should tell it what to do (which frame in the Movieclip to go to...) and it should tell the other movieclip what to do. (which frame in the Movieclip to go to...)

Also, when PeterVocals is clicked on, but the var membername is already "Peter", then it should do something else (only go to frame 11 in the movieclip). The same for MarcelBase.


This is my code:


Code:
PeterVocals.onRelease = function() {
if(membername = "Marcel"){
MarcelBase.gotoAndPlay(13);
PeterVocals.gotoAndPlay(3);
membername = "Peter";
};
if(membername = "Peter"){
PeterVocals.gotoAndPlay(11);
};
};

MarcelBase.onRelease == function() {
if(membername = "Peter"){
PeterVocals.gotoAndPlay(13);
MarcelBase.gotoAndPlay(3);
membername = "Marcel";
};
if(membername = "Marcel"){
MarcelBase.gotoAndPlay(11);
};
};
Can someone help me out? I'm pretty much stuck at the moment and I've tried to fix it, but it just won't work correctly.

Thx

Qu0t3

Variables To Control A Movie Question
Lets see how to make this simple....

I have 8 content plates, lets call them "states", as well as 8 navs at the top. These navs "call" the 8 various "states"

The goal is to have the current "state" slide out to the left and a new "state" slide in from the right when a nav is hit. This would apply to all navs / states.

One way to do it would be to do the 8 x 8 possible combinations of tweening between states possible- this is archaic [64 different ones!]

Instead I know there must be a way to do using variables. For example when "state 3" is up and you hit the 5th nav, some sort of Actionscript would querry which state is up [3], command that specific state [3] to slide left, and slide the newly selected state [5] in from thr right.

I know this sounds simple but I have done some AScript before I keep hitting walls here.

Can anyone be specific and provide details on a way to do this? I have been using if then statements and it is not working for me [if state=3 then gotoAndPlay("3out") etc...]

Please help! any ideas are welcome
Jason

Using External Variables To Control Movieclips
ok so im trying to use an external text and get the variables to tell specific movies wich frame to stop on

this is for a server company, so if one of their servers goes down they can put offline in the variable for that server and upload the new text file

im probably doing it all backwards


Code:
loadVariablesNum("servers.txt", 0);
loadVarsText.onLoad = function(success) {
if (this.s1 == offline)
{
status1_mc.gotoAndStop("offline");
}
else
{
status1_mc.gotoAndStop("online");
}
};
}


and there is 2 frames per server one labeled online and one labeled offline

Using Variables, To Control Movie Clips
ok, can someone please explain how to use variables to control buttons (movieclips)??
i get the idea of it.. i just can't write it correctly in script.
bascially all i want to do is put a variable in the movie, well in the current section of the movie, and the variable changes when u click on different buttons(movieclips).. basically like a site's navigation..
what i want to do is make a more complex navigation.. so like if i click on a button (movieclip), it plays the fade out of that button (movieclip).. then plays the fade in of whatever button (movieclip) was pressed..

its really confusing so idunno if i worded this correctly.. hopefull i did.. so if any1 can explain how to do so, that would be awsome! thanks.

Using Variables To Control A Movie Clip
ok now i saw a post about using them to control a image heigth

but what about telling a specific clip wich frame to gotoandstop


Code:
onClipEvent (load) {
loadVariablesNum("variables.txt", 0);
loadVarsText.onLoad = function(success) {
if (this.s1 == offline)
{
status1_mc.gotoAndStop("offline");
}
else
{
status1_mc.gotoAndStop("online");
}
};
}
now this has no errors but yeilds no results any help would be greatly appriciated

If Then To Control Sound Via Variables.... Confusion
I have various sound clips imported to my libary.

All of them have linkage assigned.

In my first frame, I also made sure to define each sound clip as a
variable. Ala:
Quote:




var yes = new Sound();
yes.attachSound("yes");




Now. Here's the kicker. I have a random answer generator script on a
button. The user clicks the button and it randomly assigns an answer.
Script:
Quote:




on (release) {
function ansGen() {
generate = random(16);
ans = ["F off!",
"Only Always",
"Not today",
"Put on a funky hat and then we'll see",
"Get me a new bass!",
"No",
"Nope",
"Sorry maybe some other time",
"Yes",
"Definately",
"Possibly",
"Do you like my tatoo?",
"Why are you asking me?",
"Maybe I should ask you a question",
"Try again",
"Why not?"];
_root.textbox = ans[generate];
}
ansGen();
}
on (release) {
gotoAndPlay(1);
}




My question is: Is it possible that when an answer comes up, it plays a
sound clip from the list of sound clips?

I've tried a bunch of different scripts to no avail. Right now I'm
stopping at a keyframe script that reads:

Quote:




if (textbox == "Yes") {
yes.play();
}




Help? (I tried attaching it to a dummy action movie clip, no go, I tried
_root. before each variable, no go. I figure it's a script thing that I
just can't figure out how to write.)

The only other thing to note: two textboxes. One dynamic textbox, and one input.

Help?

Control Order Of Variables Using URLVariables
I am trying to post a bunch of variables to a PHP file using URLVariables and they are showing up in a different order than I am sending them. Is there a way to control the order of the variables - like set a key for each? My code is below:


ActionScript Code:
formFields = ["YOUR_NAME","COMPANY","ADDRESS","PHONE","FAX","CELL","E_MAIL"];

var variables:URLVariables = new URLVariables();

for (var i:Number=0; i<formFields.length; i++) {
variables[formFields[i]] = formclip["field"+i].text;
}


PHP Code:



foreach ($_POST as $key => $value){
$message.= $key.": ".$value."
";


FMX04 - Control Variables In LoadVariablesNum
Hi!

I'd like to know if there is a way of controlling the variables that are sent with the AS command loadVariablesNum when calling an ASP.
Let's say I don't want to send two variables that exist in that frame.
How can you do that?
thanks!

FMX04 - Control Variables In LoadVariablesNum
Hi!

I'd like to know if there is a way of controlling the variables that are sent with the AS command loadVariablesNum when calling an ASP.
Let's say I don't want to send two variables that exist in that frame.
How can you do that?
thanks!

Using PHP-loaded Values As Control Variables
I just can't get out of this one: I have a PHP script loading entries from a database - it creates a text string like, "name1=chris&name2=jane" etc., and it ends with a variable named "records" that contains the number of entries in the output string. I then want to use this variable to control a for- statement in Flash.

Something like:

totalRecords = Number(records);
for(i=0 ; i<= totalRecords ; i++){
duplicateMovieClip( "listItem","listItem" + i, i);
}

It just won't work. The variables are all loading properly (I've made use of all the other values in the string).

I think Flash doesn't like recognizing the variable "totalRecords" as a number. The thing is, I've successfully done mathematical functions on totalRecords, displayed it in a text box, and displayed mathematical permutations of it. But the minute my for loop needs to recognize it as a control variable, the Flash player stalls and gives me the "you are trying to execute a script that is slowing down your computer. If you continue, your computer may stop running..." etc.

Anyone have any ideas? Much appreciated!

MC That Loads Another MC That Loads Another MC, Images Look Pixellated. WHY?
Is there something I can do to prevent this? I unclicked the "anti-alias" button in the properties of the imported image, and also tried making it lossless (png). For some reason the images, when I test the parent MC, still come out pixellated. Here is the hierarchy in case u don't understand where the images are:

Parent SWF (my portfolio) contains "container"
|
Loads MC (printwork.swf) into it
|
printwork.swf has a "container"
for loading external swfs
|
brochure1.swf is loaded
into the "container" on
printwork.swf.

The image brochure1 comes out very pixellated....anyone know why>???

Using Buttons And Variables To Control Movie Clips
I have 4 buttons that need to control movie clips that 'open' and 'close' ,in different positions depending upon currentframe of main timeline. I know that I need to use variables to make this work. When one clip 'opens' another must 'close'. HOW??

Help Trying To Control Timeline Using Loaded Variables From TXT File
Hi all-
I'm having a problem in FlashMX2004Pro.

I'm trying to create a rolling "virtual plasma screen" to display upcoming events at our company. This will sit on the company's home page.

On frame 1, I loadVariablesNum from a TXT file that fill in each of the dynamic text fields for the upcoming items.

But in that TXT file is also a variable that tells the Flash movie how many items are currently "live" so the Flash movie knows when to go back to the start of the timeline and repeat the loop.

This variable is "&items=X" where X is the number of items.

At various points on the main timeline, I have this action attached to the frame...

if (items == 1) {
gotoAndPlay(1);
}

However, it either ignores the if statement and keeps going, or, if I use only one =, it kicks back to frame 1 regardless of what the loaded variable is.

I've tried adding an else statement, using "eq" and "===" instead of "==". I've tried <, >, whatever.

I tried items = Number(items) to no avail.

The "items" variable is loading onto level 0 no problem. But I just can't control the timeline with the variable. The if statement won't work.

Can anyone help me?

Setting Up Global Variables..for Timeline Control?
Hey all, im new to the boards here, and pretty new to flash action scripting. Have been using flash for a few years now as a simple animation tool, and what not..but im working on a project now that is starting to be a little over my head as my scripting talents in flash are concerend.

I have a site with 5 different sections. Each section can be jumped to through a simple button..no biggie. What I need to happen is that when the user clicks the button, the timline to be triggered to play out ( to start animating off the elements that are on the screen) And when it gets to a certain frame..jump to the next section, so that the next section's graphics can come on.

Ive done this in Director before, just not in flash. It would really make the site more fluid, instead of having jump frames from 1 section to the next. If anyone could help me I would be very greatfull. Thanks in advance.

Input Variables To Control Movie Clip
Trying to build a piece where a truth table shows how a logic circuit's output responds to various combinations of inputs, using logic 1 for true and logic 0 for false. User enters a four digit output string and is able to view the gate type that will produce it. (16 possible permutations in this e.g.)
Here is what I have so far. Any help greatfully appreciated.

Nom de Guerre
//initialize variables
var input_str:String = "";

var Inner:String="";
Inner+text1.text;
Inner+text2.text;
Inner+text3.text;
Inner+text4.text;
//goto MC frame from input
function operate(){

_root.results.gotoAndStop._Inner;
}

// enter button
enter_btn.onRelease = function() {
//fill truth table out
input_strCharAt1=input_str.charAt(0);
input_strCharAt2=input_str.charAt(1);
input_strCharAt3=input_str.charAt(2);
input_strCharAt4=input_str.charAt(3);


}

Using Variables And Paths To Control Image Selcetions
Hi All
I have just read the Variables and paths tutorials but am still stuck, well not stuck dont understand where to start. i wish to create a flash program that allows the user to create a personal image (like msn wee me's). So I have 3 different head's and 3 different hair styles set as image symbols. I iwsh to use a kind of menu system so the user scrolls though the different selctions, so i.e they scroll to head 2, then scroll to hair 3 and hair 3 is then displayed on head 2. I am calling it a digital presence, so i know this digital presence (DP) is the container and my variables are head, hair, body, etc. Do i need to have each varible in a different layer? and how do i make it that when the user leaves the head section it records which varible is being displayed so the hair choices are aplied to the correct head shape. Hope this makes sense, am in desperate need of help before i have a nervous breakdown. I am not after someone to write my code but point me in the correct direction of how to resolve this issue.
steve

Please This Is An Easy Issue Trying To Use Variables To Control A Movie Clip
also using Version5. I'm trying to have my navigation animate from a menu that jiggles alittle bit in the middle of the screen but then when a button is pressed the navigation animates to the top of the screen and then the content clip plays the content that was triggered by the button. then when a button is press from the navigation that is now already animated and on the top of the page to just play that buttons content. So the content clip has two frame labels one at frame 1 then the next frame label at frame 27. its like www.davidsirieix.com but when a button is pressed the nav buttons move to the top of the page.

on the _root i have two frames both is a with a stop action and a set varable. nav=set and on the next frame nav=still between the two the frames the buttons move to different locations(the top of the page). the reason i want variable is so that the movieclip with my main content will know where the navigation is and will act according to that.

So what i've done is the navigation(the buttons) are animated on the main timeline but each button is nested inside of its own movie clip that makes the button move alittle. What sucks is that i'm having to put the Script for the button on each frame of the animation because is has already been animated. Anyway on each keyframe inside of the button clip(3 of them)i'm selecting the button and putting an action on it: pseudo
on (press)
if(_root.nav=set)
_root.content.gotoAndPlay("content made for set"):
else if(_root.nav=still)
_root.contect.gotoAndStop("content made for still")

what happens is my button doesn't do anything. Its been awhile since i got into flash but i'm pretty sure this type of stuff shouldn't be a problem. If you can help or contact me ctnyc@hotmail.com i would be really appriative of it. thanks and good luck

Placing Array Values Into Variables To Control Instances
Hi there, I am having some troubles with pulling some values out of an array into a variable and then using that variable to control an Instance value assigned to a set of buttons.

Frame 1 (scene 1) Actionscript

ActionScript Code:
gMarray=new Array();gMarray[0] = 4; gMarray[1] = 1; gMarray[2] = 1; gMarray[3] = 1; gMenuListarray=new Array();gMenuListarray[0] = "gbLaw";gMenuListarray[1] = "gbPrev";gMenuListarray[2] = "gbPower";gMenuListarray[3] = "gbHandle";


Frame 1 (scene 2) Actionscript

ActionScript Code:
for(i=0; i<=3; i++){ //if i is 3 or less do...    var gTemp1=gMarray[i];    trace(gTemp1);  // display the value held    for(j=1; j<=4; j++){ //if j is 4 or less do...        var gTemp2=(gMenuListarray[i]+j);        trace(gTemp2);        if(gTemp1 == j){ //check and see if the variable in a gM# is equal to j            gTemp2._visible=1;        }else{            gTemp2._visible=0;        }    }}


gMarray is being used to hold a value (for tracking).
gMenuListarray is being used to hold the names of the button instances.

As the script goes through the for loops it adds j to the value of whatever is in gMenuListarray item i (ie. gbLaw1, gbLaw2, etc.) then it checks if the value of gMarray is equal to j, if it is equal it makes the instance name that equals the combined value of gMenuListarray (array item plus j appended to it) visible or invisible on the stage. The problem is that Flash MX 2004 seems to be incapable of reading using this combined value to find and modify the instance, it goes into the loop, compares and then exits out without doing anything. I have check my logic using a trace command to tell me "true" or "false" and that works correctly and I have double checked to ensure that the combined value of gMenuListarray+j equals an Instance name asigned to a button on my stage.

Thoughts? Comments? Suggestions? A hammer to beat this software into submission?

How To Access Variables Set By SetVariable Method Of Activex Control
In AS2, when you call SetVariable in the flash activex control, a variable with the name specified is set in the _root. In AS3 this doesn't work; is there a way to access these variables?

Placing Array Values Into Variables To Control Instances
Hi there, I am having some troubles with pulling some values out of an array into a variable and then using that variable to control an Instance value assigned to a set of buttons.

Frame 1 (scene 1) Actionscript

ActionScript Code:
gMarray=new Array();gMarray[0] = 4; gMarray[1] = 1; gMarray[2] = 1; gMarray[3] = 1; gMenuListarray=new Array();gMenuListarray[0] = "gbLaw";gMenuListarray[1] = "gbPrev";gMenuListarray[2] = "gbPower";gMenuListarray[3] = "gbHandle";


Frame 1 (scene 2) Actionscript

ActionScript Code:
for(i=0; i<=3; i++){ //if i is 3 or less do...    var gTemp1=gMarray[i];    trace(gTemp1);  // display the value held    for(j=1; j<=4; j++){ //if j is 4 or less do...        var gTemp2=(gMenuListarray[i]+j);        trace(gTemp2);        if(gTemp1 == j){ //check and see if the variable in a gM# is equal to j            gTemp2._visible=1;        }else{            gTemp2._visible=0;        }    }}


gMarray is being used to hold a value (for tracking).
gMenuListarray is being used to hold the names of the button instances.

As the script goes through the for loops it adds j to the value of whatever is in gMenuListarray item i (ie. gbLaw1, gbLaw2, etc.) then it checks if the value of gMarray is equal to j, if it is equal it makes the instance name that equals the combined value of gMenuListarray (array item plus j appended to it) visible or invisible on the stage. The problem is that Flash MX 2004 seems to be incapable of reading using this combined value to find and modify the instance, it goes into the loop, compares and then exits out without doing anything. I have check my logic using a trace command to tell me "true" or "false" and that works correctly and I have double checked to ensure that the combined value of gMenuListarray+j equals an Instance name asigned to a button on my stage.

Thoughts? Comments? Suggestions? A hammer to beat this software into submission?

Passing Variables To Control Motion In Embedded Movie Clip
Hello,

I have this problem: I have embedded a movie clip and I use a lot of its instances in a single movie. I want to pass some variables to the movie clip so to control the movement (beginning and ending of a Motion Tween) of a dynamic text input inside it. I don't know how to do that.

Please help me!!!

Thanks in Advance,
Stratos Filalithis

Flash Loads Last
is there a way that you can make the flash load last on a page because when the other content loads on my page it lags the flash up and it goes slow, seems to only happen on IE though.........wondering if theres some kinda solution, a preloader doesnt help because its just loading the flash....thanks in advance

Flash Loads On FF Not On IE
Sounds weird right? Its always the other way around.

click here to see.

I put the Flash movie on an absolute-positioned DIV, with a transparent background. Whats wrong there? Help.

Any Way To Activate Flash Fullscreen Mode When Flash Movie Loads In The Browser
Hi all,

I want to activate Flash Fullscreen mode when flash movie loads in the browser. Without activating it through button clicks.

I tried for this using this type of code:

function goFullScreen()
{
Stage["displayState"] = "fullScreen";
}
goFullScreen();

But it is not working this way, it is working when I put this type of code:

function goFullScreen()
{
Stage["displayState"] = "fullScreen";
}
button.onRelease=function()
{
goFullScreen();
}

thanks in advance,
Vikas.

Copyright © 2005-08 www.BigResource.com, All rights reserved