loadVars problem?

Hello, friends. I have some question related with sending data from flash to database via asp and retrieve them back onthe flashpage. Because I am doing a tshirt design, so there are data on the front side and backside which I want to store in the database.

And I knew that I should use lv=new LoadVars() … to send the data. But since I have things on bothside for the textfield and imagefield, I wonder in which way is best to send these datas?

Because I use switch (case) to switch recognise the data on the specific side of the tshirt. Can i still use switch (case) in LoadVars then ?

I am not much of a Server-Side Flash person so I won’t be of much help, but it sounds to me like what you are looking for is sendAndLoad() which is a feature of a loadVars() object.

Ah… here we go… AS Reference says…

LoadVars.sendAndLoad

Availability

Flash Player 6.

Usage

myLoadVars.sendAndLoad(url, targetObject[,method])

Parameters

loadVarsObject The LoadVars object to upload variables from.

url The URL to upload variables to.

targetObject The LoadVars object that receives the downloaded variables.

method The GETor POST method of the HTTP protocol.

Returns

A string.

Description

Method; posts variables in the myLoadVars object to the specified URL. The server response is downloaded, parsed as variable data, and the resulting variables are placed in the targetObject object.

Variables are posted in the same manner as LoadVars.send. Variables are downloaded into targetObject in the same manner as LoadVars.load.

This method is similar to the XML.sendAndLoad method of the XML object.

http://www.kirupaforum.com/forums/showthread.php?threadid=17604&highlight=ahmed

Hello, friends. I just checked the link and it is quite useful. But I have something specific to ask. I am using asp to link with the database and flashpage. And In the flashpage, I should send the textfield’s content, color and font face to database, and also I have one uploaded image, I should save its directory to database .

I write my code in flash like

on (release) {
var lv=new loadVars();
lv.imageF=_root.image;
lv.galleryF=_root.galleryimageF;
lv.fronts_text=_root.fstext;
lv.fronts_color=_root.fscolor;
lv.fronts_font=_root.fsfont;
lv.frontsx=_root.x_value2;
lv.frontsy=_root.y_value2;
lv.frontsscalex=_root.scalex2;
lv.frontsscaley=_root.scaley2;
lv.send(“variable.asp”,"_self",“POST”);
}

When I open the database , I can see the image name but not its director, and the color is writen like 16711680 not 0xFF00FF. Is that ok?

And on the flashpage where I should retrieve the data back, how should I write the code for the textfield’s color and font face then?

Thanks !!

*Originally posted by SBUH *
When I open the database , I can see the image name but not its director, and the color is writen like 16711680 not 0xFF00FF. Is that ok?

That’s weird… [AS]trace(0xFF00FF)[/AS] returns 16711935 not 16711680… I don’t understand why Flash returns a different number than ASP. But as for your question… using the number it produces will work as well instead of the hex 0xFF00FF number.

*Originally posted by SBUH *
**And on the flashpage where I should retrieve the data back, how should I write the code for the textfield’s color and font face then? **

You can use the TextFormat() object to dynamically manipulate a textboxes properties, including font color.

http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary788.html

Or you can HTML enable your textbox and use HTML font tags to manipulate color…

html enabling a textbox…
http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary744.html

getting textbox to read limited HTML tags…
http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary745.html

Hello, thanks for your reference. Now I can show the things from database on the asp page like
&imageF=004&galleryimageF=2.jpg&fronts_text=hello,dear&frontsx=432&frontsy=76.5&fronts_color=16711680&fronts_font=Arial Black&frontsscalex=161.051&frontsscaley=161.051&

How should I record them to show the things on the flash page then?

I knew myData=new LoadVars();
myData.source="cart.asp"
myData.onload=function() {

}

Then what should I write inside{} to make all the things shown. Or is it unessary to put all the things inside() to get them load? how should I do?

Thanks very much in advance!

imageF and galleryimageF are two images’ names. they are located at image/ on the server folder. Fronts_text is the content of the textfield. frontsx and frontsy is the _x and _y of the textfield.fronts_color is the color of the text and fronts_font is the font face of the text. frontsscalex and frontsscaley are the x, y scale of the text