SWF and variables

Currently I’m tryin to do catalog on CD using flash. There will be 15 pages of items w/ the selections. The coding I’m using for their options is from this:http://www.kirupa.com/developer/mx/components.htm

Now my question is, since I can’t use a DB because it’s on a CD, I have to pass the variables through flash. But when they are done making all their selections how do I make an externally loaded SWF using this command:

[AS]{
getURL(“7072summary.swf”, “_level1”);
}[/AS]

read the final values that were selected on the specified pages?

I’ve read lots of the threads concering passing variables and none of them helped me.

Can anyone help?
Also if anyone knows of any way to hold a DB on a CD and be able to write to it as well as read from it lemme know :thumb:

ok. i’m not sure exactly how it’s done but i was a junior programmer on a flash project very similar to the one you are describing.

we had a virtual lab with 36 selectable items and depending upon what the user chose, a new page would be dynamically created with their selections.

if i remember correctly, on the 1st frame of the main timeline we created a new object and listed each item that could be selected in there:

selectableObject=newObject();
object1[0]=“first object”;
object2[1]=“second object”;

selectedItems=""; // you’ll populate this empty variable with their choices

then, as the user chose their items, the selectedItems variable would be populated then pulled up on the request page.

does this help a little?

fumeng.

Hmm… I understand what you’re saying, but my main problem is figuring out how to make an external SWF read the stuff that has been populated.

So basically SWF1 would be the whole movie w/ 15 pages of dropdown boxes, checkboxes, inputboxes, etc. I say 15 pages cause I’ve done a book animation thing to represent a catalog.
Say the pages hold the following:
Page1 - garmet 7072
Page2 - garmet 7071
Page3 - garmet 7070

On the last page will be a summary page, with probably only a list of available garmets ie:
7072
7071
7070

Click one of them and it calls the populated info from say Page1 which is the 7072, and puts it in an external SWF 7072summary.swf.

BTW I don’t want to use the LocalConnection feature. UNLESS I absolutely have to.

an external swf will be able to read the selectedItems variable you are populating.

think of it like this: your main movie is a shell movie that calls external swfs into it.

if you declare your new object and your selectedItems variable on the first frame of the shell movie, the external movies will be able to reference them simply by using _root. or you can make selectedItems a global variable that can be referenced as well.

Hmm… yea I tried that b4 I posted here and for some reason it didn’t work I read that in another post as well… I dunno try d/l the .fla from the end of this tutorial:http://www.kirupa.com/developer/mx/components.htm

See if you can get that populated information into another movie like I’ve described.

ok. i just finished the tutorial and got it to work. so your movie should work along similar principles, no? where are you having the difficulty?

Ok, make a button that calls an external swf

[AS]on (release)

{

getURL("summary.swf", "_level1");

}[/AS]

Now here is where I can’t call up the information. Once I call up the SWF it won’t seem to reference the base movie.

ok. i see what’s going on. you’re calling a separate flash movie and you’re trying to pass variables from 1 movie into another. i didn’t understand that at first.

is there any way where you make the second movie (summary.swf) part of, instead of separate from, the main movie?

so instead of:

[AS]on(release) {
get URL();
}[/AS]

you have an empty movie clip with an instance name of placeholder that calls summary.swf into the main movie where it will easily be able to reference the variables.

[AS]on(release){
_root.placeholder.loadMovie(“summary.swf”);
}[/AS]

know what i mean?