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




Problem With Feeding Variables With Loaded XML



Problem with feeding variables with loaded XML

If there's anyone out there who could help that would be great, i'm using mx2004.

I'm trying with not much luck to put the appropriate nodes into variables, trying to find a quicker and better way than below.

urlXML = new XML();
urlXML.onLoad = populateQuestions;
status = "Loading DATA...";
urlXML.load("ppcontent.xml");
// Function : populateQuestions
// Purpose : Takes XML data and populates questions variables
function populateQuestions() {
if(loaded == total){
gotoAndStop("done");
}
sections = new Array();
sections = this.childNodes[0].nextSibling.childNodes;
for (x=0; x<=sections.length; ++x) {
if (sections[x].nodeName == "SECTION") {// make sure we are dealing with a SECTION tag
// this is the code I am trying to get to work..............................................
// the point is to get the below line to feed all the variables.
this.ref["section"+x+"Name"+x] = sections[x].attributes.NAME;
//eval("section"+x+"Name"+x) = sections[x].attributes.NAME;

// rather than having to do these below lines over and........
section0Name0 = sections[x].attributes.NAME;// all working
section0Nav0 = sections[x].attributes.NAV;
section0Id0 = sections[x].attributes.ID;
section0Comment0 = sections[x].childNodes[1].childNodes[0];
section0Image0 = sections[x].childNodes[1].nextSibling.nextSibling

subSections = sections[x].childNodes[4].nextSibling.childNodes//.childNodes
for (y=0; y<=subSections.length; ++y) {
if (subSections[y].nodeName == "SUB_SECTION") {//if we are deailing with a subSections tag
subSections0Name0 = subSections[y].attributes.NAME;// all working
subSections0Subnav0 = subSections[y].attributes.SUB_NAV;
subSections0Subid0 = subSections[y].attributes.SUB_ID;
subSections0Comment0 = subSections[y].childNodes[1].childNodes[0];
subSections0Image0 = subSections[y].childNodes[1].nextSibling.nextSibling


}
}
}
}
}

if u can help, much appreciated



KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 03-10-2004, 09:46 PM


View Complete Forum Thread with Replies

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

Problem With Feeding Variables With Loaded XML
Problem with feeding variables with loaded XML

If there's anyone out there who could help that would be great, i'm using mx2004.

I'm trying with not much luck to put the appropriate nodes into variables, trying to find a quicker and better way than below.

urlXML = new XML();
urlXML.onLoad = populateQuestions;
status = "Loading DATA...";
urlXML.load("ppcontent.xml");
// Function : populateQuestions
// Purpose : Takes XML data and populates questions variables
function populateQuestions() {
if(loaded == total){
gotoAndStop("done");
}
sections = new Array();
sections = this.childNodes[0].nextSibling.childNodes;
for (x=0; x<=sections.length; ++x) {
if (sections[x].nodeName == "SECTION") {// make sure we are dealing with a SECTION tag
// this is the code I am trying to get to work..............................................
// the point is to get the below line to feed all the variables.
this.ref["section"+x+"Name"+x] = sections[x].attributes.NAME;
//eval("section"+x+"Name"+x) = sections[x].attributes.NAME;

// rather than having to do these below lines over and........
section0Name0 = sections[x].attributes.NAME;// all working
section0Nav0 = sections[x].attributes.NAV;
section0Id0 = sections[x].attributes.ID;
section0Comment0 = sections[x].childNodes[1].childNodes[0];
section0Image0 = sections[x].childNodes[1].nextSibling.nextSibling

subSections = sections[x].childNodes[4].nextSibling.childNodes//.childNodes
for (y=0; y<=subSections.length; ++y) {
if (subSections[y].nodeName == "SUB_SECTION") {//if we are deailing with a subSections tag
subSections0Name0 = subSections[y].attributes.NAME;// all working
subSections0Subnav0 = subSections[y].attributes.SUB_NAV;
subSections0Subid0 = subSections[y].attributes.SUB_ID;
subSections0Comment0 = subSections[y].childNodes[1].childNodes[0];
subSections0Image0 = subSections[y].childNodes[1].nextSibling.nextSibling


}
}
}
}
}

if u can help, much appreciated

Feeding Variables To .swf In A Link
For reference, I'd like to ask everyone if there's a way for a scripting language to pass variables(like the ones captured from a URL) and send them to Flash, telling it to begin at a specific frame.

We'll likely be using .NET or Javascript to send the commands.

Functions - Problem With Feeding In Variables
Hi there, here's a simple Flash problem I am having. Please take some time to help me out!

I have a function on the main timeline:

Code:
function move (v1, v2, v3){
m = (v1-v2)/v3;
v2 += m;
}

I am trying to call this from within a mc placed on the timeline called 'sq'.

In the 'sq' mc I have this code:

Code:
_parent.move(200, sq.sq_mc._y, 5);

'sq_mc' is a movieclip in the 'sq' mc and all I want to do is move its ._y with the simple inertia script.

How do I reference it? I know it works when it's not in a function. I've tried all these for var2:

Code:
_parent.sq.sq_mc._y
_root.sq.sq_mc._y
sq_mc._y

None work! What is going on?

Many thanks for your time,

Neil

External Text File Feeding Variables....
I am sure that this is an easy problem, but I have been racking my brain for hours on this one and have yet to find an answer. I am using Flash MX. In the text file there is a variable defined as such:
&maxi=-9
In flash I am trying to us the value -9 as a "Number", I found out that when you load Variables in this way the value is always loaded as a string.
So Set this var:
maxscr = Number(maxi);
If I trace maxi I get -9 if i trace maxscr i get NaN. If I trace type of maxi I get a string, If I trace maxscr i get a number. So why can't I get maxvar's value to be the number -9?

Thanks!

Feeding Arrays From Xml
Hi I am pulling in some lyrics from an xml file, and Im wanting to store them in an array, so I can access them from time to time, after the initial xml code has been fired.

Code:
var lyrics:Array = new Array();
var lyricNum:Number;
function getLyrics(xmlData)
{

xmlNode = xmlData.firstChild.childNodes;
lyricNum = xmlNode.length;
lyric = [i];

for(i=0;i<lyricNum;i++)
{
lyric[i] = xmlNode[i].attributes.lyric;
lyrics[i] = lyric[i];
trace(lyrics); //this Does trace the contents of the array
}
}
trace(lyrics);//this won't pick up the array - Why when I have placed my variable outside of the for loop in the root code!?
I have laid my case in the code where the traces reside. Can anyone help why I cant access the array after the for loop has been processed - it says it is undefined.

!!Thanks!!

How They Are Feeding In Data In This
well
we are learner of flash

we found this nice flash movie...
http://www.euro2008.uefa.com/tournam...#DATE#09/06/08

as we know that this is dynamic...but it seems really smooth and fast on retriveing data

how they are retrieving data..
xml file,php or other dynamic files

we decomplied with the motive of learning but no luck

it is too avance level learning?

Blog Feeding Flash?
Hello is there any way in which I can get the posts on a blog to feed a seperate flash site??

thanks

Feeding Array Into Function
I'm forgetting the correct syntax here. I've got a function that I want to feed an array of movie clip names into, like so:


Code:
var clipArray:Array = new Array();
function revealDetails(clipArray):Void {
trace(clipArray);
}
revealDetails(skills_mc,experience_mc,personality_mc);

Flash Feeding From An XML File
Hi all,

Please help as I am quite a novice in flash but I need to perform a task with it :(  Basically I have a set of images list in an xml file that are pulled to created an swf file as a top banner in the website.  Problem: I have that lot working.  The only thing now is that, for every section of the website, I want the swf file to use different sets of images defined in the one xml file.  i.e

CODE<?xml version="1.0" encoding="utf-8"?>
<Homepage>
    <image title="" url="Australia_2 2007.jpg" />
    <image title="" url="1.jpg" />
    <image title="" url="2.jpg" />
</homepage>

<AboutUs>
    <image title="" url="Australia_2 2007.jpg" />
    <image title="" url="1.jpg" />
    <image title="" url="2.jpg" />
</AboutUs>


Multiple Movieclips Feeding Off One Function
Hey Gang,

Aside from placing the same function into each MC, how can I set up one function that multiple MC's can access without causing any interuption if another MC is currently using it? I have a function that expands a MC, the _name is defined in a parameter and while MC1 is in the process of expanding MC2 taps the function to expand it. The problem really isn't when it expands because only one can expand at a time, but there can be multiple MC's collapsing at the same time and this is where I get trouble. The most recent collapsing MC seems to take over stopping any other collapsing MC. Hope is makes any sense. Thanks in advance.

Lance

Feeding In Information From A MS Access Database
Hello all,

I'm currently building a new Flash site for <http://www.buona.com/> on behalf of one and my affiliates. Most of it is fairly straightforward. However, please take a look at this page <http://www.buona.com/catering/expresscatering/menu.asp>. The information on this page is fed in from an MS Access database using ASP. The client enters the information via his own content management system. He wants to keep using this database system - is there an easy(ish) way to feed this dynamic information into a Flash page. I have some limited previous experience with PHP / MySQL but very little with ASP / MS Access so any advice would be appreciated. This project is still very much at the drawing board stage at present.

Thanks.

Ian

Feeding ContentPath To A MediaPlayback Component
Well here is my idea: i have a page where i would want to open a new window when i press an icon next to the song title and have a MediaPlayback Flash component to play that song.
A standalone MP3 is not OK..has to be either incorporated (only playing part) into the choosing page or the way im trying to do.
Something with the overall design...
So..is there a way to feed the component contentPath to the song when i click on the icon? Maybe via PHP and loadVars? Ive tried something like this already but didnt work. Although in worst case scenario ill just create a swf file for each MP3

This is what i tried though:
the code i put on mediaPlayback

Code:
on(load){
var dataIn = new LoadVars();

dataIn.onLoad = function(){
var conPath = this.komad;
player.contentPath = conPath; //player is an instance name of MediaPlayback component on Stage
}

dataIn.load("peeppop.php");
}
in php


Code:
<a href="#" onclick="
<?php
echo '&komad = music/01.mp3&';
?>
"><img src="images/zvocnik.gif" /></a>

Feeding Selected Content To Users
Has anybody got any ideas on this subject.

Feeding selected flv content from a PHP/MySQL database. The link to the contents will be placed on different sites I.e A, B, and C.

I want users from site "A" to only pull "A" content. The content in question is a flash FLV player that would play flash videos.

My assumptions:
Login System and use that to determine what gets delivered. ( Hate the login idea)

Create an FLV Player for each of the sites ( Too much, what I get 300 sites to add the linkage. I would rather use an FLV Template)

I am open to any other solutions. Thank you Ultrashock..

[MX 2004] Problems With Feeding Flash Movie From Database
i am working on a flash portfolio that is supposed to be fed from a MySQL database. Until early today everything worked just fine, but then i had to change the structure of my database. initially i had just 2 tables, news and work... now i added links, photo, digital etc, and dropped work...
and it just doesn't work anymore... it's strange as i did nothing to the news section for example...

i have included the fla, the php scripts that send the XML to flash as well as a query of my database in the following zip archive...
http://www.transcent.ro/vilosophe/vilosophe.zip

Please take a look and explain me what is the problem... i think just one example would be enough for me to take over from there...
thanks a lot

[MX 2004] Problems With Feeding Flash Movie From Database
i am working on a flash portfolio that is supposed to be fed from a MySQL database. Until early today everything worked just fine, but then i had to change the structure of my database. initially i had just 2 tables, news and work... now i added links, photo, digital etc, and dropped work...
and it just doesn't work anymore... it's strange as i did nothing to the news section for example...

i have included the fla, the php scripts that send the XML to flash as well as a query of my database in the following zip archive...
http://www.transcent.ro/vilosophe/vilosophe.zip

Please take a look and explain me what is the problem... i think just one example would be enough for me to take over from there...
thanks a lot

[MX 2004] Problems With Feeding Flash Movie From Database
i am working on a flash portfolio that is supposed to be fed from a MySQL database. Until early today everything worked just fine, but then i had to change the structure of my database. initially i had just 2 tables, news and work... now i added links, photo, digital etc, and dropped work...
and it just doesn't work anymore... it's strange as i did nothing to the news section for example...

i have included the fla, the php scripts that send the XML to flash as well as a query of my database in the following zip archive...
http://www.transcent.ro/vilosophe/vilosophe.zip

Please take a look and explain me what is the problem... i think just one example would be enough for me to take over from there...
thanks a lot

Set / Get Variables From Swf Loaded In Mc
Is there any way to get the variables / set variables in a swf file (from a main container swf file) after its loaded and running in a movie clip?
Also is it possible control the properties of the swf file loaded in the movie clip from the contaniner movie clip?

Many thanks!
mav

Using Loaded Variables
Hi everyone,

I'm trying to change the variables loaded from a text file and set the finished string to a textfield. Can someone tell me why the variables won't load from the text file.
(This is the only code in my fla file.)
//--------------my text field / works great.
_root.createTextField("theTextBox",20,50,50,200,30 0);
theTextBox.background=true;
theTextBox.border=true;
theTextBox.backgroundColor=0xFFFFFF;
theTextBox.borderColor=0x000000;
theTextBox.multiline=true;
theTextBox.html=true;
theTextBox.wordWrap=true;
theTextBox.variable="buslist";
myTextFormat = new TextFormat();
myTextFormat.font = "Arial";
myTextFormat.size = 12;
myTextFormat.color=0x000000;
theTextBox.setNewTextFormat(myTextFormat);


var mytext = "";
//gather these variables from welcome.txt
//mytext=Welcome|to|my|dynamic|page
loadVariables("welcome.txt","_root");


// HERE IS THE PROBLEM
// mytext isn't set to anything
trace(mytext);
busAR = new Array();
var oplist = mytext;
trace(mytext);
busAR = busAR.split('|');
for(i=0;i<oplist.length;i++){
buslist += "<A href=page"+i+".html>"+busAR[i]+"</A><BR><BR>";
trace(buslist);
}

Getting At Those Variables I Just Loaded
Here's the problem. I am loading variables from text files into an array so that i can keep them neatly organized and easily referenced (an array of LoadVars). This is how I am loading it:

// Load the variables
page [page_current] = new loadVars ();
page [page_current].load ("txt/"+id+".txt");

The problem is that once this is loaded I haven't been able to access the individual variables. Would someone explain to me how this works?

Thanks in adance.

Using PHP Variables Once Loaded
I'm retrieving variables from PHP using the loadVariables method just fine. Once they're there, I'm having trouble getting them to do what I want. Is it possible to use them for anything other than the content of a dynamic text box?

The output of my PHP file is this:
echo "&myMusic=song.mp3";

I want to be able to use the variable myMusic in another object's method, like so:
loadVariables("myFile.php", this);
firstSound = new Sound();
firstSound.loadSound(myMusic, true);

The above code doesn't work... If I create a textbox with the name myMusic on the same timeline, the content shows up as 'song.mp3' when published, so I know flash is receiving the variable. If I forget about PHP and declare the variable within Actionscript everything works fine as well.

Is there a fix for this or another method that will retrieve the variable so it can be used this way? I hope it's not just that variables from outside sources are treated differently and I'm out of luck :P

Variables Not Loaded Where I Want Them
I have a movie called search.swf

While writting it and exporting it to test, everything was ok. But the idea behind the search.swf was that it was suppose to load in another movie named main.swf.

I thing I have a problem while loading variables from a txt file when testing search.swf within main.swf. The line goes like this in the frame of the search.swf :

loadVariablesNum("http://localhost/directory/export.txt",0)

Am i loading the variables in the main movie??? What would the problem be ?

Thanks

If Loaded Variables
Hi

I'm creating a site for a client. The test site is below

http://www.thisisallgood.com/clients/urbanid/index.html


When the main navigation loads up there are 2 x levels loading in the background with movieclips on them (advance video loops). If the user stays in the nav till they are loaded then when they click through to a section they get turned off, by visible movieclip script.

However if the user quickly clicks through to a section then the animation starts and half way through the movies appear all ou of place (they only fit in the main nav).

If anyone can have a go with the link at the top, try both ways, click and wait on the main nav for movies to appear, then go back and quickly click through and see what I mean (may need to dump cache as they are made to stay loaded).

I need to have an 'if not loaded visible = false command' of some sort!! I'm not an advanced action scriptor.

Any help would be greatly appreciated.

thanks

Paul

Variables From Loaded Swf
I have an external swf loaded into level 10 that contains a button. When the button is clicked it sets a variable among other things. After this though, I load another swf into level 0 (main timeline), replacing the original one. Now, from this new swf in level 0, I am trying to use the variables I set in the swf on level 10. The swf on level 10 is still loaded, so shouldn't the variables I set still apply? The player ignores the variables though.

script on the button:

Code:
on (release) {
gotoAndPlay("2");
var go = "banana";
_level0.gotoAndPlay("Ben banana forward");
}


script on a frame in the second swf loaded on level 0:

Code:
if ( go == "banana" ){
gotoAndPlay("1", "Ben Banana Death");
}
else{
gotoAndPlay("nextFrame");
}


Is the code containing the variables correct?

How Many Variables Are Loaded?
hi
if I use a LoadVars to load variables, is there a way to know how many variables where loaded?? (other than coverting the viariables to string and counting the "&"s)
thankss!

Using Loaded Variables In Url
I have a text file from which I load a variable XML_path using:

loadVariablesNum ("get_xml_path.lasso", 0, "POST");

A dynamic text field on the stage with var set to XML_path displays the variable: 90ZESJAN06

However, when I try:

var my_url = ("http://myurl.com/flash/" + XML_path + ".xml");
trace (my_url);

I get: http://myurl.com/flash/.xml

What am I doing wrong?

Thanks

Variables In A Loaded Swf - HELP
I have "file1.swf" loading "file2.swf" as follows:


Code:

var myVar:String="hello";

var myloader:Loader= new Loader();
addChild (myloader);
var request:URLRequest = new URLRequest("file2.swf");

myButton.addEventListener(MouseEvent.CLICK, loadIt);

function loadIt(event:MouseEvent):void {
myloader.load(request);
myloader.x=100; //I can see file2 is on top of file1
}
How can I get the value of myVar from file1 into file2? Referencing myloader in file2 does not work…not sure where to go from here. Note, both files are in the same web folder.

(Right now I am missing loadMovie and _global ;-<

NNH
(Newbie Needs Help)

Else/if With Loaded Variables
I'm trying to create a quick prototype of an application so i decided to use text file based variables. This was an hours work that has turned into a days worth of hassle!!

I just cannot get the else/if statements to work with my variables...
Here is a simplified code that I am trying to use:

Code:
myData = new LoadVars();
myData.onLoad = function(){
displaybut();

};

myData.load("variables.txt");



function displaybut(){

if (myData.quest == 1){

trace ("it worked");

}else{

trace ("damn it");

trace (myData.quest);

}

}
This is the text file:


Code:
dispp=just some text
&quest=1
This is what it traces:


Code:
damn it
1

I don't understand why it does this! Please help me....

Variables From A Loaded Swf
hey, if i set a variable from an swf that i load into the main movie, will the main movie recognize the variable?
thanks

Loaded Variables To Print
Please help a no brain


This is a problem that I cannot seem to get over, maybe I'm just stupid, but I can manage to get a set of vaiables loaded into a .txt files to enter a MC, having a separate move clip to print out located of screen with the following attached to the button

On (Release, Key: p)
Comment: Check Flash player version
Set Variable: "playerversion" = eval("$version")
Comment: Grab minor version number
Set Variable: "versionnumber" = Substring ( playerversion, 9, 2 )
Comment: If minor version is 20 or higher, print - otherwise ask them to download the new player
If (versionnumber >= 20)
Comment: Tell invisible movie clilp "/print_clip" to play
Comment: ("/print_clip" can be found just ouside the movie area to the right - use Ctrl-Shift-W or Command-Shift-W to expand workspace)
Begin Tell Target ("/print_clip")
Set Variable: "ScrollText" = /var_load/History_print.swf:ScrollText
Play
End Tell Target
Else
Begin Tell Target ("/print_clip")
Go to and Play ("noprint")
End Tell Target
End If
End On
now now do I get the variable to load and print out??


Also how can I use the above to load a set of variables with user input to print out on a pre designed form?

please help gurus

Variables Between Loaded Movies
I have a main movie with 8 buttons. Each one of those buttons loads an intro movie on level2. Halfway through that movie, there is an action that loads another movie onto level 1... the purpose is to have an intro that serves as a pre loader/movie intro that clears the screen and hides the fact that another movie is being loaded below it.

The intro is the same for every movie, so I don't want to make 8 separate intro's. My problem is this:
How do I write the code, so that when a button is pressed in the main movie, it loads that intro on level 2, and halfway through that loaded movie, it reads a variable that tells the action which button was pressed so that it loads the correct movie onto level 1?
-B

PASSING VARIABLES TO LOADED SWF's
lets say my main movie has 2 buttons. they open the same external swf file.
if you click on button 1...it will set a variable(button1) and then the external swf file load and should display the info for button 1.
but if you click on button 2...it will set a variable(button2) and then the external swf file will load and should display the info for button 2.

this script is in the external swf file on frame 1.
if(variable=="button1"), go to and play 2
else if(variable=="button2"), go to and play 3

so what i need is for the main movie to set a variable and then have the loaded swf read that variable.

Any help will be greatly appreciated!

ps..im tring not to use java...only flash

Using Loaded Variables (not For A Textbox)
How do I check the value of a loaded variable? The only thing loadVariables() seems to load is the text for dynamic textboxes. When I trace() any variables i get nothing back, so obviously I can not check their value. Can anyone explain this? Thanks.

Variables In Loaded .swf Files?
is it possible to change a variable in a nested .swf?

Check To See If Variables Loaded
what is the best way to check to see if variables are loaded?
i have a dunamic textbox that is getting it's text from a php file writing to and then reading back in, and i have a "smart" text scroller that resizes it's scroll bar from the maxscroll properties, but i nedd an action on the clip that checks to see if the variables are loaded b4 it does it's thing, can anyone help?
thanks in advance.
bb

Getting Variables From Loaded Swf File?
Hello Freinds.

I'm a begginer - and my problem is:

I got dynamic text field on _level0 with variable name:
var1

and on first frame of my movie
var1=10;

button to load external movie clip with action:
on (release) {
loadMovie ("externalMovie.swf", 2);
}

inside of my externalMovie.swf on first frame i placed
n = 20;
_level0.var1 = (var1+n);

when i press button externalMovie.swf is loaded
but var1 insdead to be 30 is replaced by n so it's 20,
the goal i want to reach is to place button on
_level0 which would retreive value n from external movie on _level1 and pass or add it to var1.

please help!!!

kooba

Using Loaded Variables With AttachMovie...
okay.. i am dumbfounded... here's the scenario...

I set up idnames for some library elements:

eel
spottedray
shark
angelfish

on the stage, there are 4 MCs named slot1, slot2, slot3, slot4 with no alpha adjustments

Then in frame 1 I loaded variables from a text file as such:

&character1=eel
&character2=spottedray
&character3=shark
&character4=angelfish

then in frame 2, I set the file into a loop until character1.length > 1 (to make sure they are loaded)

on frame 3 I have it execute this:

slot1.attachMovie( eval("character1"), "slota", 0)
slot2.attachMovie( eval("character2"), "slotb", 0)
slot3.attachMovie( eval("character3"), "slotc", 0)
slot4.attachMovie( eval("character4"), "slotd", 0)

unfortunately, it doesnt load anything into the slots. If I replace the eval with like "eel", it loads fine, but I think because the attachmovie command is looking for the idname to be in quotes, its not working. I thought that the eval command would solve this, but obviously not. What am I missing?

what I am trying to do is be able to change what character is loaded into what slot by just changing the variable text file, thus modifying content on the fly without reworking the flash file.

Any and all help is deeply appreciated.

MacAddict
http://www.torqdesign.net

+ Symbols In Loaded Variables
Hello everyone I have a problem. I am pulling variables in to flash from a data base, one of those variables is a url, these urls have + symbols in them. When flash gets the variable it changes the + symbol to a [space]. This corrupts the url and thusly it doesn't work in the browser. I cannot change the variable being sent to flash. the database won't allow it. how can I get flash to not change the symbols to spaces? Thanks in advance

Felix_Man

Detecting Variables In Loaded SWF
I am loading a movie containing an activity into another.
So I am loading it into level 3 and it works fine until the activity checks the variable 'totalvalue' (which updates fine in a dynamic text feild I have added to check).

So when the submit button in the loaded movie is click the following code is processed:

on (press) {
if (_root.totalvalue==19) {
_root.gotoandplay("success");
}
if (_root.totalvalue<>19) {
tellTarget ("_root.wrong") {
gotoAndPlay (2);
}
}
}

Even when the 'totalvalue' is 19 it always goes to the wrong result... run it on its own and its fine. how do I target the variable when it is loaded into another??

Displaying Loaded Variables
Hi,

I am running a query on a Cold Fusion page that basically requests all SKU numbers and their Finishes. There are roughly 10 SKUs.

In my flash movie I have an action on the first frame:

container.loadVariables("rt.cfm");

On the main stage, I have a empty MC instance named "container". It has the following actions on it:

onClipEvent(data) {
_root.sku = sku;
_root.finish = finish;
}

When I run this I get 1 SKU and 1 finsish to show up in their corresponding fields. I would like to display all that are returned. Can anyone give me any pointers on this?

TIA,

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);
}
}

LoadMovie And Variables In The Loaded Swf?
i use a control.exe to load 2 external swf files depending on what time of day it is, but when i load them, the loadvars and external text files dont load into the swf files. is this a targeting problem, do i have to rewrite the code in the 2 swf files to use the parent targets?
any ideas will help, Jeff

Refreshing The Loaded Variables
You probably guessed what kind of problem I have. But if not, I'll tell you.
Imagine this, I open an swf file, the swf file loads variable from a txt file and keeps on loading reapetedly, now I don't touch swf(keep it open) and go to txt file, I make changes there with the variables and save the file, then go to my flash that I left open, and what I see??? The variables didn't change.
I've tested everything, writing "if getBytesLoaded!=getBytesTotal" in the frame between the next frame that loads variables again didn't work, and "ifLoaded" didn't work at all. Why?
Please help me, if you don't have time to explain me, you can just send me an example fla to my email selimhanov@excite.com.
Thank you!

How Do I Tell If Variables Have Loaded From A Database?
Please someone help.

I am making a interactive CD.

I need to load variables from a server if the user is online.
Simple - just use load variables right? Well if the customer is offline, I want to tell flash to load another set of variables that are hard coded into the swf as a back up.

How do I tell if the variables are loaded or not so flash knows to use the back up variables in the swf?

Thanks a million!!

Variables In Loaded Movies
Hi,
I have a loaded movie that contains an mc that requires a
variable 3 to go to the next frame. I have an on enterframe
variable in the parent movie that Im trying to sent to the loaded movie but cant seem to target it correctly. The variable Im trying to send is in the second mc.

<<first mc>>
on (release) {
_root.tracker = "1";
unloadMovie ("_root.container");
loadMovie ("photo5.swf", _root.container, "POST");
}


<<second mc>>

onClipEvent (enterFrame) {
_root.container.slacker = "3";
}

see anything thanks

Calculating Loaded Variables
I am trying to load variables from a text file into dynamic text fields in a swf, then use those values to calculate percentages, which the results will be used to scale 2 movie clips.

Its a (simple) bar graph application which shows sales percentages for our intranet. I am not a super Actionscript user but am very familar with it.

my text file:

&target=2,000&
&tgoal=1,000&
&sales=1,500&

and heres my code so far in frame 1/1:

loadVariablesNum("values.txt", 0);
_root.tarperc = sales2/target2; ------- (to be shown in dyn text field on level0)
_root.tgoalperc = sales2/tgoal2; ------- (to be shown in dyn text field on level0)

(I havent finished the %age calc because I cant even get the decimal value to return, I keep getting NAN)

variables tarperc & tgoal should be able to calculate the percentages, which i then will apply to 2 separate movie clips as follows:

BAR 1 (Target Goal Graph)
onClipEvent (enterFrame) {
_yscale = _root.tarperc;
_y = 232.2;
_x = 23.8;
}

BAR 2 (Tier Goal Graph)
onClipEvent (enterFrame) {
_yscale = _root.tgoalperc;
_y = 232.2;
_x = 47.4;
}

Any input would be greatly appreciated as I am stumped.

thanks!
eric

Loaded Text Variables
Please go to www.inmotion.net.au to view the following problem!

I have scrolling text loading as separate swf's-only problem is it creating uneven spacing between paragraphs, even though the remote .txt files have even spacing between paragraphs. How can I successfully format text from loaded variables?

Got any ideas?

Loading Variables Into A Loaded SWF
I am creating a dynamic slideshow that uses a set of variables to determine which external movie to load into the main movie (each external movie is an image & a soundtrack).

The variables that determine which movie to load are as follows:

currentSlide
nextSlide
prevSlide

My question is this: when the loaded "movie1.swf" is finished playing, I need it to tell the main movie the following:


Quote:




currentSlide = currentSlide+1;
nextSlide = nextSlide+1;
prevSlide = prevSlide+1;




and then automatically load the next movie (movie2.swf) based on the above mentioned parameters, so something like:


Quote:




loadMovieNum("movie"+currentSlide+".swf", 1);




I got the loading to work when a user advances through slides manually (i.e. clicking on the next/prev buttons in the main movie), but I can't figure out how to make it advance automatically. I tried changing currentSlide to _root.currentSlide, but no luck.

Could someone please point me in the right direction? TIA

Variables From A Loaded Movie
Ok, let me try to explain this.
I have a main movie file that needs to load and unload movies that are being used in a drop down menu. This menu resembles the Windows File, Edit, etc. menu. Everytime the user clicks one of these categories it loads a new movie, and after the category times out, or another is clicked it unloads the first. Due to this rapid loading and unloading of movies, there is not much time to retrieve a variable if the user clicks a button. For some reason I cant for the life of me retrieve a variable from these menus. I have tried just plain setting them in the main movie from within the loaded menu. Ex _root.variable = "value";, but to no avail. I have also tried issuing a GoTo command from within the loaded menu that goes to a frame the attemps to retrieve the variable. Ex variable = _root.navBar.File.variable;, which also didnt work. Im sure there is a simple error that I am missing.

[help] Getting Variables Into A Loaded Movie
hey people. i tried 'search' but kept getting an error, so sorry if this has already been asked,

i dont really know how to explain it but i'll try my best ->

im making games for my site where the user wins 'points' to spend on items and other things and basically in each game i want to be able to load a movie into the 'gameover' screen so that it sends to score to the php file to add to the database. The only problem i have with this is that i cannot get the 'score' into the loaded movie

_root.score = (the score)

in the game file.
how do i load the separate swf and get the score variable into it?

Tia

??

jagopth

PS. I have tried eveything in the loaded movie, ( score2send = _root.score , score2send = _level0.score , score2send = _parent.score )

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