Retrieve things from database to flash via asp?

Hello, I have flashpage to retrieve the information for asp page.

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?

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

Thanks very much in advance!

Hoi

in the onLoad function you can call them with this.varName and out side (when they are loaded) yourLoadVarsName.varName
for example…


myData=new LoadVars();
myData.source="cart.asp"
myData.onload=function() {
_root.fronts_mc._y = this.frontsy
}
if(myData.loaded){
_root.fronts_mc._x = myData.frontsx
}

:wink:

hello, friend. how about the images and the color and font face of the textfield then? I am confused at this point! Thanks

[AS]
myData=new LoadVars();
myData.source="cart.asp"
myData.onload=function() {
/* Create a textformat for the textfield and assign it to the textfield*/
frontformat = new TextFormat();
frontformat.font = this.fronts_font;
frontformat.color = this.fronts_color;
_root.fronts.setTextFormat(frontformat);

/Load the two images in movieclips with the instance names holder1 and holder2/
_root.holder1.loadMovie(this.imageF)
_root.holder2.loadMovie(this.galleryimageF)

/Set the properties of the textfield/
_root.fronts._y = this.frontsy
_root.fronts._x = this.frontsx
_root.fronts._xscale = this.frontsscalex
_root.fronts._yscale = this.frontsscaley
}
[/AS]

… I think. Never worked with ASP though.

The imageF variable from the asp file is 004, with no extension. You might wanna take a look at that. And also at the color variable from the asp file, it’s 16711680., while it should be something like 0xFF0000.

What master64 was mentioning is that loadVars is an object, which means that you can always access the vars using myData.variable. For example, myData.frontsscaley =)

Sorry about that i thought you wanted to know about how the loadvar worked :-\

oh and Voetsjoeba you have a type0


/*Load the two images in movieclips with the instance names holder1 and holder2*/
        _root.holder1.loadMovie(this.imageF)
        _root.holder**2**.loadMovie(this.galleryimageF)// there was a 1 and not a 2

Oh, right :slight_smile: Thanks for pointing that out meester64 :wink:

Hello, thanks for both of you indeed. Now it is working. And I correct my mistake so that now the imageF and galleryimageF are both ended with .jpg

But because my pictures are all in the folder uploadedimage on the server

I tried to use
_root.imagemc.loadMovie("/uploadedimage/"+this.imageF)
_root.gallery.loadMovie("/uploadedimage/"+this.galleryimageF)

But nothing loaded. Do u have any suggestion about this then? thanks again!

[AS]
myData=new LoadVars();
myData.source="cart.asp"
myData.onload=function() {
/* Create a textformat for the textfield and assign it to the textfield*/
frontformat = new TextFormat();
frontformat.font = this.fronts_font;
frontformat.color = this.fronts_color;
_root.fronts.setTextFormat(frontformat);

    /*Load the two images in movieclips with the instance names holder1 and holder2*/

imF = “uploadedimage/”+this.imageF
imgaF = “uploadedimage/”+this.galleryimageF
_root.imagemc.loadMovie(imF)
_root.gallery.loadMovie(imgaF)

    /*Set the properties of the textfield*/
    _root.fronts._y = this.frontsy
    _root.fronts._x = this.frontsx
    _root.fronts._xscale = this.frontsscalex
    _root.fronts._yscale = this.frontsscaley

}
[/AS]

If this swf is in the same folder in which the folder uploadedimage is and if imagemc and gallery are on the main timeline.

Yes, exactly right now. Thanks very much for your help!! Best Regard!!!

You’re welcome :slight_smile: