PDA

View Full Version : php


KingCHAD
11-15-2002, 08:13 AM
If i was sending some variables to a php file that then save them as a txt file what format should they be in because I've done this and they look like this, but they dont load back in when i call them from flash.

r:0
mclength:500
mcheight:300
xposhline:173.65
yposhline:11.65
xscalehline:666.666666666667
yscalehline:0
alphahline:100
rotationhline:0
xposvline:173.65
yposvline:11.15
xscalevline:0
yscalevline:400
alphavline:100
rotationvline:0
xposdoorleft:196.55
yposdoorleft:277.75
xscaledoorleft:100
yscaledoorleft:100
alphadoorleft:100
rotationdoorleft:0
xposdoorright:80.3
yposdoorright:250
xscaledoorright:100
yscaledoorright:100
alphadoorright:100
rotationdoorright:0
xposbasin1:195.4
yposbasin1:217.15
xscalebasin1:70.9808349609375
yscalebasin1:70.7839965820313
alphabasin1:100
rotationbasin1:-90
xposbasin2:99.55
yposbasin2:278.35
xscalebasin2:70.2835083007813
yscalevbasin2:70.5841064453125
alphabasin2:100
rotationbasin2:0
xpostoilet:200
ypostoilet:154.3
xscaletoilet:65.960693359375
yscaletoilet:69.207763671875
alphatoilet:100
rotationtoilet:-90
xposbidet:202.25
yposbidet:102.85
xscalebidet:100
yscalebidet:100
alphabidet:100
rotationbidet:0
xposbath1:620.6
yposbath1:109.7
xscalebath1:80.35888671875
yscalebath1:79.5791625976563
alphabath1:100
rotationbath1:0
xposbath2:79.2
yposbath2:250
xscalebath2:100
yscalebath2:100
alphabath2:100
rotationbath2:0
xposshower1:416
yposshower1:69.7
xscaleshower1:100
yscaleshower1:100
alphashower1:100
rotationshower1:-90
xposshower2:80.3
yposshower2:250
xscaleshower2:100
yscaleshower2:100
alphashower2:100
rotationshower2:0
xposvoid:400.6
yposvoid:357.1
xscalevoid:2127.65957446809
yscalevoid:2127.65957446809
alphavoid:100
rotationvoid:0

Also i have put a button in the movie where i need them to load which has this on it...

on (release) {
loadVariablesNum(textfield+".txt", 0);
}

and in a keyframe I have this...

xposbath1 = xposbath;
yposbath1 = yposbath;


xposbath1 is the variable I used in the first movie and bath is the name of the movie clip in the second movie.

Is this right?:confused:

tg
11-15-2002, 08:40 PM
format should be:

&r=0
&mclength=500
&mcheight=300
&xposhline=173.65
&yposhline=11.65.....

&rotationvoid=0&

i always add the '&' at the end of the last value also(but it is not necessary)... it trims any unexpected gargage from the file.
actually, the file would be better without the carriage returns. cause the value for the variable r is actually 500\n (i think its \n... maybe \r).

LuxFX
11-16-2002, 06:40 PM
Originally posted by tg
the file would be better without the carriage returns. cause the value for the variable r is actually 500\n (i think its \n... maybe \r).

it depends on what OS you are editing the file in. In windows, it's actually \r\n, which flash interprets as two line breaks.

I definately recommend leaving out the line breaks.

Also remember that since & and = are special characters you cannot use them in your variable names or values themselves. Instead, use the escape versions, which are %26 and %3D, respectively (I've got a list of all the escape values at http://www.dreamdynamics.com/escapechart if it helps)

Technically you should use escape values for any non-alphanumeric characters, but those two are the particularly important ones....

tost
11-16-2002, 09:56 PM
lux, about the \r\n,
we had to solve that because clients were inputting dynamic text into a database from windows files,
we had a line in the php-script to replace the urlencoded chars,
i don't write the php, but it was sumthin like
ereg_replace ("%0A%0D","%0D")
it's probably not correct but you see what i mean

thought it might be usefull :)

LuxFX
11-16-2002, 10:04 PM
thanks mate!