Jump to content

This topic is 7867 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

Just because i think that Flash makes pretty good looking interface, and is pretty uncrashable...

I m trying to get access to a Filemaker pro database from a swf... (macromedia flash animation)

If anybody has ever done it before, i would be glad to share info...

It feels like i should try to understand the CDML usage but i have never heard of this...

Posted

Yes you can. Look at the function 'getVariables()'. You can use a URL in this function, the format file can look like this (just a single line):

var1=[FMP-Field: myfield1]&var2=[FMP-Field: myfield2]

Hope this helps.

Garry

  • 6 months later...
Posted

I would like to use flash and Filemaker pro also, but I am still a little confused. could you give an example of what the action script would look like ?

Posted

You can use the 'loadvariables()' actionscript. It can be used to query and edit a database.

Example:

loadvariables("/FMPro?-db=mydb.fp5&-lay=CGI&-format=myvars.txt&-findany",0)

The 'myvars.txt' format file could look like this:
myvar1=[FMP-Field:myvar1]&myvar2=[FMP-Field:myvar2]

The variables myvar1 and myvar2 would have been declared at level 0.

Hope this helps.

Garry

  • 5 months later...
Posted

I am a little clueless about this and I am trying to muddle my way through a basic contact form where the user submits some information to the database . Could you take a look at what I have done so far to see if you can see what I am doing wrong ?

The contact.fp5 and the swf file are in the same folder

I defined the variables for the Input text fields

I added this actionscript to the submit button

on (release) {

loadvariables("FMPro?-db=contact.fp5&-lay=dataentry&-format=vars.txt&-new",this,"POST");

nextFrame();

}

My vars.txt file:

date=[FMP-Field:date]&email=[FMP-Field:email]&firstname=[FMP-Field:firstname]&lastname=[FMP-Field:lastname]&phone=[FMP-Field:phone]

Posted

web companion is enabled, the pages work as html. I have searched the web and I can not find any documentation anywhere on how to use cdml and action script together. If I had an example, I think I could follow it, but I'm don't know enough to figure it out from scratch.

  • 4 months later...
Posted

Your example works well, can you tell me how to list a found set of records?

-I have changed the URL string, and tested the format file and all is ok, but how can I get flash to list the found set and have them set as activet links.

Posted

I don't know enough about Flash to know how it would process a text-based array.

Maybe the Format file can produce a Comma-Delimited text steam. Flash may have Functions for converting this to an Array.

All the best.

Garry

Posted

Following on from garrycl's response, if the format file can produce a string delimited by commas (or any other delimeter) then you can use this code...

myArray =myDelimetedString.split(",");

Where myArray is a new Array created by the split function, and myDelimetedString is the Comma delimeted string you have passed to Flash by the format file. Change the comma in 'split(",")' to whatever your delimeter is.

You could do this with as many delimeted strings as needed then you have a series of Arrays that can be used and abused in Flash.

HTH

  • 3 weeks later...
Posted

Hi Gary,

This is my first time tring to get Flash to talk to FM. I have used this thread as an example but I'm missing something. I saw some talk about example files?: Is there anyway to get ahold of a example file of a .fla, fp5 and txt.

Thanks for the Help.

Posted

Thanks for the help. Gary

I'm almost there. I get a filemaker error of 4 (big help)

Attached are my files. I was wondering if you or some one could look at and tell me whats worry. This is driving me mad. confused.gif

Posted

Todd,

Unfortunately I do not have Flash. I'm travelling at the moment so I will not be back to where the Flash developer I work with until the 31Jul.

Please show us the line of code for "loadvariable()"

All the best.

Garry

Posted

Here is my code.

on (press) {

loadVariablesNum("http://10.0.1.2/FMPro?-db=test.fp5&-lay=cgi&-format=var.txt&-new", this, "POST");

nextFrame();

}

I have a input field on one frame with the var name of name and a button that uses the above action scirpt.

One fileMaker file that has one text field: named name.

Sharing is set to web companion and the filemaker app has the web companion is on.

One text file named var.txt and the content is: name=[FMP-Field:name]

Thanks again for the help.

Posted

Todd,

I've tested the URL in a Browser and it works fine. I guess that you have done the same thing.

I think, however, that the method should be "GET" not "POST". This maybe what is causing the FM "command unknown" error.

Hope this helps.

Garry

Posted

Gary, I tried the get option and got a total diffrent error message. It said unknow comand used.

Maybe my error is in the HTML file. Does the SWF need to be between form tags? Do I need the hidden fields: suchas format, error, DB....?

Thanks

Posted

The problem is that I can not pass variables to filemaker using Flash Loadvarables.

Trying to create a new record in FM with the info I type into my flash movie.

on (release) {

loadVariablesNum("http://192.168.100.67/FMPro?-DB=flash.fp5&-lay=web&-format=var.txt&-new", 0, "POST");

}

This will give me a filemaker error of 4 (unknown).

If I change the POST to DON't SEND. This will create a new record in the DB but does not pass the Variables to the new record.

I read last night in Flash 5 action script Reference guide that a command of

GET: will append the variables to the end of the URL up to 128 charters.

on (release) { loadVariablesNum("http://192.168.100.67/FMPro?-DB=flash.fp5&-lay=web&-format=var.txt&-new", 0, "GET");

}

POST: send the variables in a separate header.

on (release) {

loadVariablesNum("http://192.168.100.67/FMPro?-DB=flash.fp5&-lay=web&-format=var.txt&-new", this, "POST");

}

DO NOT SEND; will send no variables.

on (release) {

loadVariablesNum("http://192.168.100.67/FMPro?-DB=flash.fp5&-lay=web&-format=var.txt&-new", 0);

}

I think that the web companion needs to have the variables before the last tag (-new,-find,-delete.......) in the URL.

have you or do you know anyone that has push info from flash to Filemaker?

Again Thanks for your help. tongue.gif

Posted

We were using Flash to maintain player's scores and dates for an online game.

To update the FM database we used:

loadVariable("http://123.123.123.123/FMPro?-db=scores.fp5&-lay=cgi&-format=var.txt&-edit&",0)

I don't have the syntax with me for including the values into the URL. However, you may be able to do something like this:

loadVariable("http://123.123.123.123/FMPro?-db=scores.fp5&-lay=cgi&-format=var.txt&-edit&",0,score,-recid)

Where "score" and "-recid" are variable names used in Flash. Also, note that I have included a "&" after the "-edit".

Good Luck.

Garry

This topic is 7867 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.