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








Storing And Loading Values With Flash Executable


Dear all,

I have written a flash application to do calculations on a evaporator.

http://home.hccnet.nl/m.dijk/pressur...lcs/calcs.html

Now the user is asking to store his calculations and reload them whenever the stand-alone *.EXE is started again. How can I do this?

Please tell me you advice, many thanks,
Carfi




FlashKit > Flash Help > Flash ActionScript
Posted on: 09-15-2003, 11:07 AM


View Complete Forum Thread with Replies

Sponsored Links:

Storing Values In Variables?
Wondering how I can I store variable information so that when a movie is relaunched it can retrieve that data...

a thanks ahead for you help

View Replies !    View Related
Storing Values Using Loop
I have five buttons on stage and I simply want to trace "1" when I click the first button and trace "2" when I click the second button and so on.

Here is the code

Code:
var buttonsArray:Array = new Array('sil_btn', 'sfl_btn', 'srl_btn', 'srf_btn', 'shpl_btn')
for(var i:Number = 0; i< buttonsArray.length; i++)
{
i = pressed;
this[buttonsArray[i]].onRelease = function()
{
trace("buttonNumber"+i)
}
}
I am always getting the last number and cannot figure out, how to store the values.

View Replies !    View Related
Storing Values Using Loop
I have five buttons on stage and I simply want to trace "1" when I click the first button and trace "2" when I click the second button and so on.

Here is the code


Code:
var buttonsArray:Array = new Array('sil_btn', 'sfl_btn', 'srl_btn', 'srf_btn', 'shpl_btn')
for(var i:Number = 0; i< buttonsArray.length; i++)
{
i = pressed;
this[buttonsArray[i]].onRelease = function()
{
trace("buttonNumber"+i)
}
}

I am always getting the last number and cannot figure out, how to store the values.

View Replies !    View Related
Question About Variables - Not Storing Values?
I'm having a trouble with variables that really makes *no* sense to me whatsoever. It goes against everything I've learned in any coding language. Why is it that flash seems to arbitrarily decide when it will and won't store a value into a variable? I know that that's obviously not the case, but I've been tracing a variable to figure out why my if statement is never executing.

I have a movie clip that I've created with code using the attachmovie function. The object is named "sprite" afterwards.

I've created a sprite.onLoad = function(), and in that, several variables are declared, including the one I'm testing, canMove. Then, in the sprite.onEnterFrame = function() event, I have it tracing canMove. canMove is set to true in the onLoad function, but when I trace it, I get 'undefined'.

I tried to declare canMove in the onEnterFrame function, for testing purposes. I declared it the line ABOVE the trace, and I still continuosly got 'undefined'.

I changed the code from
code: var canMove:Boolean = true;
to
code: var canMove:Number = 1;
and I continued to get undefine. Finally, I just said,
code: this.canMove = 1
and I got a result.

So, I moved the code back to the onLoad event, and again started getting undefined.

What is the difference between all these declarations? Why does this.canMove = 1 and not var canMove:Number = 1 work? This is really frusturating me, as this is supposed to be a really simple line of code, yet it's stopping me cold in my tracks.

View Replies !    View Related
Storing X/y Values During Mouse ISDOWN
I'm working on a painting app that lets you paint freehand on the stage. I need to store the drawn values (x1,y1,x2,y2...xn,yn) in an array and export them. Is there anybody that could help me revamp my current function to accomplish this?

Here's the function that controls the freehand:


Code:
MovieClip.prototype.freeHand = function(){
if(isDown){
c.lineTo(this._xmouse, this._ymouse);
trace(this._xmouse);
}
}


Thanks!

View Replies !    View Related
Storing Unique Values - PROBLEM
hi there,

I have a problem with storing unique values in collection array. One value is constructed with "h" + changable value from a - l + number from 1 - 8.
I made dynamic script that user can construct value for example ha1 or hd5 or hb8 etc and stores them in collection array. collection array should store only unique values. But unique values can be only differentiated by changable value from a - l. So if collection has ha1 it can't have ha2 as a happens twice and its not unique. So if user choose ha2 and there is already ha1 in collection array then ha1 is going to be replaced with ha2. Is this clear?
Anyway, I have done the script I attach below and i will appriciate anyone how is going to help me as I get slowly mad. At the moment after selecting any a value the message is traced saying the "a" is detected.

It is bit complex script but I know it can be done quite easy way, but I am still learning ActionScript.

Here is coding:


PHP Code:




var credits:Object = new Object();
var hourValue:Object = new Object();
var hourName:Array = new Array();
var collection:Array = new Array();
var collectedValues:Array = new Array("a", "a");

for (var p:Number = 97; p<109; p++) {
    hourValue = "h"+chr(p);
    hourName.push(hourValue);
    //trace(p);
}
for (var i:Number = 0; i<109; i++) {
    credits = _root["tab"+chr(i)];
    credits.letter.text = chr(i);
    creditCharacter = chr(i);
    credits.onPress = function() {
        creditLetterSelection = this._name.substr(3, 1);
        for (var k:Number = 0; k<hourName.length; k++) {
            _root[hourName[k]].onRelease = function() {
                this.hours.text = creditLetterSelection;
                twoLetters = this._name.substr(0, 2);
                oneLetter = this._name.substr(1, 1);
                if (collection.length<12) {
                    temp = "h"+oneLetter+creditLetterSelection;
                    collection.push(temp);
                    for (var l = 0; l<48; l++) {
                        switch (collection.join("").charAt(l)) {
                        case "a" :
                        case "b" :
                            trace("detected:"+collection.join("").charAt(l));
                            break;
                        }
                    }
                    trace(collection.join(""));
                } else {
                    stop();
                }
            };
        }
    };
}







thanks a lot for any help

View Replies !    View Related
Storing X/y Values During Mouse ISDOWN
I'm working on a painting app that lets you paint freehand on the stage. I need to store the drawn values (x1,y1,x2,y2...xn,yn) in an array and export them. Is there anybody that could help me come up with a function to accomplish this?

Thanks!

porp

View Replies !    View Related
Storing Several Values Externally And Updating Them
I think I need a bit of help here.

I am working on a piece in which I want to keep track of what all users -- whenever they might view the piece -- do within the piece. There are really only two options for users [A or B] and I want to keep track of what each viewer does and then the total number of viewers.

I have no problem getting info from external txt files via loadVars; my question is whether I can then change the content of a txt file out of flash.

Alternately is there a way I can trigger a JAVA class to perform the necessary manipulations of the txt file.

I am hoping there is a way I am missing for ActionScript to rewrite a txt file that I am missing, or perhaps some other way to store an variable that can be accessed and updated each time a new user views the piece that isn't reset each time the swf is loaded.

I would greatly appreciate your suggestions.

Thanks.

View Replies !    View Related
Storing Values In Multiple Loops
for (var s = 0; s<mainSections.length; s++) {//grabbing the fabric types Handblocks,Screenprints,and Wovens


for (var i = 0; i<subSection.length; i++) { //grabbing each fabric design of the fabric type


for (var d = 0; d<matSection.length; d++) {//grabs each material type sub section of each fabric design

for (var t = 0; t<startThumbs.length; t++) {//finally processing the thumbs within the material type section.



I have these forloops going through an xml file. getting each section, sub section... eventually getting to the actuall fabric and thumbnail.

So in the last forloop is where I load the thumbs. When the person clicks a thumb I want to record the values of s i d... t I can store in a holder variable but the rest I dont know how to record.

Essentially I want to know what thumb the person clicked.

View Replies !    View Related
Self Executable And Loading Mp3's From Cd Rom
im creating a cd rom and im trying to load the mp3s dynamically....but the only question is im unsure on how to load them thru a path instead of a url.....any help???
thanks,
chris

View Replies !    View Related
Loading PHP Database Values Into Flash
I wish to load values from my PHP database into my Flash swf.

My PHP looks something like this;

$result = mysql_query("SELECT joke FROM Jokes where jokeID='0'");
$cant = 0;
while($row=mysql_fetch_array($result)){
echo "jokeID$cant=$row[JokeID]&joke$cant=$row[joke]&";
$cant++;
}
print "cant=$cant";

This returns the joke number and the joke.


My actionscript is the part I think is letting me down;

myLoad = new LoadVars();
myLoad.onLoad = function(done){
for(var i in this) {
joke.text += "
"+i+" = "+this[i];
}
}
myLoad.load("index.php");




I have a textfield called joke that is dynamic.



Can anyone help me to get this to work?

View Replies !    View Related
[F8] Loading External Values Into Flash
Hi all, I am trying to make a photoalbum that uses an external file for passing a variable to Flash for the number of pics to set my array,
this is what I have for code
myData = new LoadVars();
myData.load("external.txt");
myData.onLoad = function (success) {
if (success) {
NOI = Number(NOI);
trace(this.NOI);
gotoAndStop(2);
} else {
trace("error loading");
}
}
then in frame 2 of actionscript I have this
stop();
var LocationToImages = "pics/";
var FileType = ".jpg";
var x = 0;this
var jpg = new Array();
var i = 0;

while (i <= NOI)
{
jpg[i] = LocationToImages + i + FileType;
i++;
} // end while
//load first JPG into container
loadMovie(this.jpg[0], this.container);
reason I broke it up into 2 frams is that it will give flash time to parse the code and to make sure its loaded before continuing
and this is what I have in my external text file
NOI=29
the problem I get is everytime I test this, I get message saying script is causing the flash player to run slowly do you wish to continue, Now I tested the actual myData loading and it traces out properly, it shows the number that is in the external text file, I am thinking the problem is Flash is not assigning that number to the jpg array?
my basic Idea for this is to create a photo album that the user will not have to edit and republish the FLA in order to add or subtract pictures and text files, all he would have to do is add the JPGs and txt files to the folder and then edit the external.txt file for number of pictures/text files that are in this folder, can anyone help me on this or point me to a tut that explaines this thanks D_wiz

View Replies !    View Related
Flash Movie Not Loading The Values From Xml File Initially
Flash movie published on the server not loading the content (values) from xml file initially, but it gets loaded when I refresh the page both on IE and Firefox.

Anyone there have a solution??!!

Thanks,
K

View Replies !    View Related
Flash Executable
I haven't done this in so long I forgot how. In Flash for PC, how do you save out as an executable? In Flash under file/publish preview/ I only have Default HTML, Flash and HTML; the rest are grayed out including projector. I just want to be able to save flash work out as .exe
Any help is appreciated

Thanks,
Jeff

View Replies !    View Related
Executable Flash?
I just finished my first Flash project which we will be using as a presentation for an upcomming trade show.

I would also like to use this as an executable movie that can be sent out on cd. Is there a way to make this cd auto start?

View Replies !    View Related
Flash Executable
Hello!

I need to create a presentation that will run on a HP PDA with Windows Mobile 5. This application should run full screen... How should I export that projector in order to run on Windows Mobile? I've exported normal projector that runs perfectly on non mobile versions of Windows...

I've tried to make it a swf and open a html in a browser window, but I always have a title bar and a status bar of the browser on the screen and I really don't want that...

Please, suggest...
Thank you

View Replies !    View Related
Loading + Storing An External Image As A MovieClip, Then Displaying It Later
I have a class:


Code:
class Component
{
var image_mc:MovieClip; // the image data itself
var image_filename; // filename of the image

function Component(filename)
{
image_filename = filename;
image_mc = new MovieClip();
loadMovie("http://localhost/" + image_filename, image_mc);
}
}
Then in some other code, of course, the object is created:


Code:
var _root.foo:Component = new Component("helloworld.jpg");
How can I display root.foo’s image (imagemc) on the stage at some point down the road? I have tried something similar to root.add(root.foo.image_mc); and that didn’t work (not even if I set the _x, _y, and _visible variables of the imagemc member).

View Replies !    View Related
Flash Running An Executable?
Is it possible to have flash run an executable such as a setup.exe on the click event of a button. Im working on a cd that has multiple directories with a flash front end(menu and all) and I want to be able to run the exe's in the dir's from within flash?

any help would be great

View Replies !    View Related
Launching Executable From Flash
Hello, I'm not sure if this is possible, but is there a way to have Flash launch an executable. I'm working on a CD that would require launching of another application on the CD with a ".exe" extension.

I've tried 'geturl' but that opens up a browser and requires the user of the CD to launch from the location or save to disk. It also doesn't look that great.

My end result is that I would like to have the user of the CD click on a button in the flash movie and have the other application launch. Any help on this would be greatly appreciated. Thanks, Jeremy

View Replies !    View Related
Launching An Executable From Flash
Is it possible to launch a non flash executable from flash? Specifically, from a standalone flash player.
thx

View Replies !    View Related
How To Launch An Executable With Flash?
I'm using fscommand to try to pull this off. Here is the code I'm using on a button to launch the executable:

on (release) {
fscommand("exec","Viewer.exe");

}

If the flash SWF is in the same folder with the "Viewer.exe" (on the same level), it ought to launch - right? I tried using a path to the file first, but couldn't get the exe to launch (I have a feeling the path may not have been complete). I s this a better way around using a path to launch it?

Thanks for any help!

View Replies !    View Related
Flash Executable CD-ROM Licensing?
Does anyone know any licensing information about distributing a CD-ROM with Flash executables on it?

Macromedia is pretty clear on run-time licensing for Director executables (which is basically including the "Made with Macromedia" logo on the CD and sending in a licensing agreement form) but I can't seem to track down similar documentation for Flash executables.

Any help on this would be greatly appreciated.

Sean

View Replies !    View Related
Executable Launches Behind Flash
I am launching a couple executable files using fscommand from a flash file that has been published as a stand-alone file. Most of the time it works perfectly, but every once in a while the executable launches behind the flash window and it appears to the user that the link didn't work. Does anyone know a fix to this? Thanks.

View Replies !    View Related
Self-executable Files In Flash Mx
I've created my company's website on a cd rom business card disk. The file is in "Projector" format (.exe). What I want is for it to self-execute when the user slides the cd-rom compartment into the computer. Same on exiting. When the user clicks the "exit" button the projector file closes and the cd-rom compartment slides out. How do I do it?

Many thanks
magyar

View Replies !    View Related
Flash Player Executable Name In Task Bar
A few weeks ago I posted a question asking if there is a way to rename the Flash Player executable so that the new name shows in the task bar. I didn't have any responses back then so I am trying again to see if I am any luckier this time. so to recap.

I need to be able to rename the Flash Player executable so that it shows a custom name in the task bar rather than "Macromedia Flash Player 6"

Any ideas?

View Replies !    View Related
Creating .txt File From Flash Executable
Hi!

I'm trying to develop an app that will allow users to take notes during presentations. I found some interesting solutions to output those notes as a .txt file. But they rely on third parties, such as other script languages (one interesting solution uses JavaScript functions in the HTML code).

Is it possible to make a standalone Flash executable do that? I need a clue. Would it include working with system resources (the app will run on Windows, mainly)? Any hints would be appreciated.

View Replies !    View Related
Flash 9 Plugin For IE Executable Install?
I keep a library of Flash plugins for testing my companies Flash development in the various versions. I have a page on our intranet for downloading both the IE version and the FF/Mozilla/Opera/etc. version. I'm trying to locate an installation executable for version 9 of the IE version. This doesn't seem to be posted anywhere. Anyone know where I could find it?

View Replies !    View Related
How To Make My Created Flash To Be Executable
is there anyone knows how to solve my problem??
i want to make my file made in flash mx 2004 to be a ecutable something like a installer..

View Replies !    View Related
How Do You Load In An Executable File In Flash?
Hey,

Just wondering if anyone can help me out a little bit...

I want to attach an action to a button where when the user clicks on it this button, it loads up an executable file?

Appreciate the responses in advance.

View Replies !    View Related
Flash Executable Quits With No Message
Hey all,
I have a program that is not "crashing" per se, as I get no error message or anything, but occasionally it will just quit out. Can overloaded memory do this, or perhaps a certain type of error in the .exe. It doesn't happen with any specific behavior that I can tell, but haven't seen the actual behavior every time it has happened. When I programmed in Director, there would be a clear error message from the player about what the error was, but Flash fails silently when acting as a stand-alone .exe player, and when errors do occur, they usually just manifest themselves as bugs or odd behavior, not actually exiting from the program. As a result, I am not even sure where to start looking. I know that I don't have any commands to quit the program in there, as this is a stand-alone kiosk at a visitor center. Any ideas?

- B

View Replies !    View Related
Latest Flash Player Executable...
Experts...

is there a site somewhere where I am able to download the latest Flash Player Exe - the one that will install the player on a users PC?

I am about to distribute Flash Content via DVD and know that some PCs wont have the player or a connection to the iNet to download it from the adobe site.

Many thanks...

View Replies !    View Related
Mailto Form From Flash Executable
I need to send data by mail from a exe, I have made in flash, I´m not using any server or database, just a mailto.

Please suport this thks.

Faby

View Replies !    View Related
Launching A Browser Window From A Flash Executable
Hi guys, I've run into a small problem launching a browser window on top of a flash exe.

I recently created a flash cd demo and once placed in the cd drive it launches and scales to fit the screen
fscommand("fullscreen", "true"); now when I launch a browser from a link provided it appears in front of the demo (which is what I want) but problem is if I don't close that previous browser window and try to launch another from the flash demo, it appears "behind" the flash movie.

So bascially I would like to know if there's a code snippet that keeps the browser window always on top.

it's been driving me nutz

please help

salud

View Replies !    View Related
Creating An Executable Flash File From A Dynamic Swf
Does anyone have any info re: creating a executable flash player movie, from a swf that is using dynamic data? Of course the portable version would be static from the current data.

example: many of you may have seen the code on the boards for a really nice photoviewer that loaded jpg's externally. I'd like to somehow be able to make a portable CD version of it. Executable if possible?

ie someone has a slideshow they have created and uploaded thier own images, and the ability to export that show to and executable for burning to a cd is where I'm going with this.

Anyone, Anyone, Anyone... VooDoo Economics

View Replies !    View Related
Detecting Other Applications (ie. Quicktime) From A Flash Executable
Good Morning!

I'm working on a flash based cd interface that we are saving off in the .exe format. Some of the content on the cd requires certain programs to be installed and I wanted to know if there is a way to detect wether other applications (besides but also including flash) are installed. If so, how is that acheived?

View Replies !    View Related
How To Open An Executable Program In A Flash Button. Please Help.
Dear ActionScript.org members,

Hello, a pleasant day to everyone.

I just want to know how could I open an executable program in a Flash Button? I know I should use the on(release){} function but I don't know what comes next. I have two Flash buttons, the first button should open Windows notepad (notepad.exe) and the other one should open an executable program that I have created in Visual Basic (i.e. MyCalc.exe).

I hope someone could give me a quick guide to this.
Thank you and God bless everryone!


Warm regards,

MarkSquall

View Replies !    View Related
Can An External Executable To Pass A Variable Directly To A Flash Projector
I have produced a flash front end for an item of software: click on a button to install the software, you know the stuff.

Now, there is a piece of software called BDE that is required for the main software to run, and you can easily detect if it is installed. So, what I want the flash front end to do is only enable the install software button if the BDE software is detected.

I have written a little .EXE that checks to see if BDE is installed, and it is a simple matter to have the executable to create a text file on the HDD, and then have the projector read that file, and check for a specific value.

But what I want to know is: is it possible for an external executable to pass a variable directly to a flash projector without creating an intermediary text file. The purpose being to enable the install software button if BDE is installed.

The reason why I want to do this, is OSs like Win2k / NT file permissions might not allow the creation of an intermediary text file.

View Replies !    View Related
Viewing Movies Imported Into Flash 4 When Exported As Executable File
I am importing quicktime files into flash 4 and I want to publish the flash file as a windows projector (executable file) so that I can put it on CD Rom and have it autostart. When I publish the file to windows projector and view the finished executable file the video does not show up. I can view the flash animation, graphics, and even hear the imported wav file, but there is no video. Can anyone tell me what I need to do to include a QuickTime Video (mov) file in a flash file to create a finalized Executable (exe) file?

Please Help. I know it can be done, just don't know how to do it. If you know of anything that can accomplish this please let me know.

Thanks.

View Replies !    View Related
Storing Data With Flash?
Is there anyway to store data in any type of external file using FlashMX?

Cheers

View Replies !    View Related
Storing Data In Flash
I want to set up a Flash file that stores data.

I'm not sure if this is possible, but basically I want the Flash file to have an input box and a button. The user can type data into the box (i.e. their name) and when the button is pressed the name is saved and can be viewed elsewhere in the Flash file. The problem with this is I want the name to be available even after the file has been closed and then opened again. The only solution I can think of is for Flash to save the data to a .txt file. Is this possible and, if so, can someone tell me how?

Thanks in advance!

View Replies !    View Related
Storing Password In Flash?
Hello =)

Probably a stupid question, but something that I have not been able to find an answer for. I have a website (first flash site, no laughing!) that is here when you click on "secure area" it will prompt you for a password.

Type in "950" and click enter.

Now the problem I have, is when you view say a ... PDF file - it will take you out of the flash movie. When you hit back - it takes you back to the password box. This is a site for realtors, and they are going to be hitting back quite a bit to reprint documents. How can I have it, so when they DO hit back - that it will take them to the portion of the .swf after the password?

I'm still kinda a flash noobie, but I learn fast! Any help would be appreciated =)

Thanks

-Nafetski

View Replies !    View Related
Storing Data From Flash...
Hey there

I am wanting to create an application in flash where the user inputs some data and it is stored in a file on their PC, but I am wondering what is the best way to do this?

I have looked at XML and Cookie files but cant seem to think what is the best and easiest method... also is there any tutorials relating to the problem I have?

Much obliged if you can aid me in my quest

Fatwood

View Replies !    View Related
Xml - Loading Default Values
I have an XML script which loads the default values based from when a button is clicked. The button is dynamically generated from the XML script.

I want to remove the button completely. And I want the first Section by default without the need to click a button.

http://www.ultimadg.com/clients/ppag/testimonials.html

Please send me an email and I will Send All files needed to help me through this one .

View Replies !    View Related
Loading Values Into Movie
hi everyone.
i play an online game called runescape. and as part of this game there are highscore listings.
i want to know if i can get the values off the highscores list and put them into my movie.
i have seen this done in php like can be seen in this link:
http://www.rsbandb.com/sig/sig.php?n...ampinoman&.jpg
i was just wondering if there is anyway to do this in flash because i do not know any php scripting.

thanx in advance, champinoman

View Replies !    View Related
Reading Values Set When Loading Swf
Hi all, I've got a unique situation on my hands.

I have some server side code that takes a url visited and returns a swf file. This swf file needs to know the address that it is being loaded from so that it can take certain actions.

So if I have:
- example.com/ex1/movie.swf
- example.com/ex2/movie.swf

I need the video to be able to know if it is being loaded from ex1 or ex2.

Is this possible without JavaScript being present in the code loading the swf file? If not what alternatives would be available to me?

Thank you.

**As a note I am working in Flex 3 so all related libraries are available.

View Replies !    View Related
Loading External Values From .txt
Hello all I been using flash AS2 for quite some time, and recently (due to a job assignment) started reading AS3, and it is so so differant and new and need help =(

I have 2 files, a flash file (test.fla) and a text file (web_size.txt) where i want to store variables using name-values pairs, which i want to convert to global variables. (which can be accessed via any other function anywhere, anytime, any frame)

web_size.txt content

Code:
x_value=1000&y_value=300
and for the test.fla, i modified from a few tutorials and got the following.

Code:
var x_value = 0
var y_value = 0

var myLoader:URLLoader = new URLLoader()
myLoader.dataFormat = URLLoaderDataFormat.VARIABLES
myLoader.load(new URLRequest("web_size.txt"))
myLoader.addEventListener(Event.COMPLETE, onDataLoad)


myLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, onHTTPStatus)

function onDataLoad(evt:Event){
x_value = evt.target.data.x_value
y_value = evt.target.data.y_value
}
The problems i faced is that the codes...
1) dun work at all, cant seem to figure why >.<
2) im storring each .evt.target.data."value" manually one by one, i need a more flexible way to just store all the name-values pairs from the .txt file automactically
3) even when i copied from tutorials directly, i could not turn the variable into a global variable (it could only run inside onDataLoad)

i need to solve all these problems, for i intend to use the variables to create a highly coustomisable flash website =(

View Replies !    View Related
Loading XML Values In A Loop
Hi friends,

This is my XML. I want to read the values in a loop.

<?xml version="1.0" encoding="utf-8"?>
<Resources resname="IMAGE" language="English" code="eng">

<page pagename = "IMAGE">
<Resource tag="LOGO">images/logo.jpg</Resource>
</page>


<page pagename = "IMAGE">
<Resource tag="CONTACT">
<active tag="active">images/contact.jpg</active>
<inactive tag="inactive">images/contact1.jpg</inactive>
<over>images/contact2.jpg</over>
</Resource>
</page>


</Resources>


I had written a for loop to retirve the value. i got - images/logo.jpg, but now I need one more inner loop to get tge values - images/contact.jpg, images/contact1.jpg, images/contact2.jpg

help me....
this is my for loop

function loadImage(ab) {
var nidearr1 = importXML1.firstChild;
var nidearr = nidearr1.childNodes;
for (var i = 0; i < nidearr.length; i++) {
//trace(nidearr[i].attributes.pagename);
for (var j = 0; j < nidearr[i].childNodes.length; j++) {
//trace(nidearr[i].childNodes[j].attributes.tag);
varres=nidearr[i].childNodes[j].attributes.tag;
if (res==ab){
return nidearr[i].childNodes[j].firstChild;
}
}
}
}

This is the function call
trace(loadImage(tag));


The value of the tag is taking from the XML file.

View Replies !    View Related
Loading XML Only Returning Some Values
Hi Folks,

I am new to XML and am a bit rusty in my Flash skills so forgive me for my stupidity but any answers should please take this level of ignorance into account.

I have a 1 frame file with three movie clips on it. Each clip is the same as the others but is differentiated by the instance names: mc1, mc2, mc3.

The movie clips each have three dynamic text fields: title, body and link.

The problem is only the text fields in the mc1 movie clip get populated the others return as undefined.

Little Help?

I have included xml and code below.

thanks

Al


----------------------------XML (myxml2.xml)---------------------------

<?xml version="1.0"?>
<content>
<item>
<title>First Website</title>
<body>First Website text</body>
<link>http://www.firstwebsite.com</text>
</item>
<item>
<title>Second Website</title>
<body>Second Website text</body>
<link>http://www.secondwebsite.com</text>
</item>
<item>
<title>Third Website</title>
<body>Third Website text</body>
<link>http://www.thirdwebsite.com</text>
</item>
</content>


-----------------------Action Script---------------------------------

var xmlPath = "myxml2.xml";
function loadXML(loaded) {
if (loaded) {
mc1.title = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
mc1.body = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
mc1.link = this.firstChild.childNodes[0].childNodes[2].firstChild.nodeValue;
mc2.title = this.firstChild.childNodes[1].childNodes[0].firstChild.nodeValue;
mc2.body = this.firstChild.childNodes[1].childNodes[1].firstChild.nodeValue;
mc2.link = this.firstChild.childNodes[1].childNodes[2].firstChild.nodeValue;
mc3.title = this.firstChild.childNodes[2].childNodes[0].firstChild.nodeValue;
mc3.body = this.firstChild.childNodes[2].childNodes[1].firstChild.nodeValue;
mc3.link = this.firstChild.childNodes[2].childNodes[2].firstChild.nodeValue;
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(xmlPath);

View Replies !    View Related
Storing Variables In A Flash Movie
To store a variable in Flash 4, is it a necessity to put it into a text field??

Will the movie just store the value *there* in the movie, rather than me having to create god knows how many text fields to hold them?

If that doesn't make sense, think of it as ASP or PHP scripting or something. You can have variables flying about but they aren't actually STORED anywhere - they just exist as abstract objects. Does Flash do this, or do I need a text field?

Ta,

Nick

View Replies !    View Related
Flash Assessment Scoring And Storing
Hello,

I've been asked to build two Flash MX assessments and need some help tracking the answers and presenting the scores after the user finishes. After looking through the posts and MX templates, I've got more questions than answers.

Seems there is no sure way to do it, but can anyone give me some direction on the best way to store scores (I've heard ASP or XML) and report them back in to Flash. Also what is the best way to create the question pages (multiple movies or one large one). We have an LMS, but would rather keep these strictly in Flash and HTML if possible.

One assessment will let the user give two scores to a scenario. We'll then we'll take the scores, add them up and report them back at the end.

The other one will just have the user picking the best possible answer, that will have a number associated with it in the background. Once they're done, we'll add it up and plot it for them on a grid.

Are there any good reference sources or sample code available to view for these types of projects? Since my Flash experience up this point has dealt mostly with a single movie and animations, this should be a challenge!

TIA!

Troy

View Replies !    View Related
Flash Quiz Scoring And Storing
Hello,

I've been asked to build two Flash MX assessments and need some help tracking the answers and presenting the scores after the user finishes. After looking through the posts and MX templates, I've got more questions than answers.

Seems there is no sure way to do it, but can anyone give me some direction on the best way to store scores (I've heard ASP or XML) and report them back in to Flash. Also what is the best way to create the question pages (multiple movies or one large one). We have an LMS, but would rather keep these strictly in Flash and HTML if possible.

One assessment will let the user give two scores to a scenario. We'll then we'll take the scores, add them up and report them back at the end.

The other one will just have the user picking the best possible answer, that will have a number associated with it in the background. Once they're done, we'll add it up and plot it for them on a grid.

Are there any good reference sources or sample code available to view for these types of projects? Since my Flash experience up this point has dealt mostly with a single movie and animations, this should be a challenge!

TIA!

Troy

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved