PDA

Volledige versie bekijken : flash berichtenbalk


Tijntje
%Europe/Berlin %570 %2005, 14:40
hoi lui, mijn eerste post hier dus alvast excuses als ik iets verkeerds doe maar heb dringend hulp nodig..

ik heb hier een berichtenbalk (http://www.tijn2u.nl/flash/berichtenbalk.html).. deze wil ik koppelen aan mijn mysql database.. alleen ben ik goed in php maar weet ik niet wat ik flash moet veranderen om wat in de database staat in flash te brengen?
ik heb wat tutorials gelezen maar kom er niet echt verder mee...

Zou iemand kunnen helpen?

mattle
%Europe/Berlin %585 %2005, 15:03
ik weet alleen ong. hoe je met je database moet connecten.
je moet alle variabellen volgens mij laden in flash uit je bijv. config waar je database connect scripts staan.
en dan moet het volgens ij lukken (volgens ij zeg ik het verkeerd) :( P)

Laiverd
%Europe/Berlin %609 %2005, 15:37
Via het LoadVars object roep je een php bestand aan dat waarden uit je database haalt en die als variabele terug echoot naar Flash.

John

Tijntje
%Europe/Berlin %758 %2005, 19:11
Via het LoadVars object roep je een php bestand aan dat waarden uit je database haalt en die als variabele terug echoot naar Flash.

John

ik ben wel wat wijzer maar niet wijs genoeg om nu hiermee rond te komen. zou jij mij kunnen helpen om eenmalig mij uit kunnen leggen hoe ik precies in flash de php bestand oproep en hoe ik de scripting aanpas in de flash?
Ik weet dat ik heel vervelend ben maar ik wil graag leren hoe het precies moet zodat ik niet steeds hier hoef terug te komen.

Martijn

Laiverd
%Europe/Berlin %764 %2005, 19:21
E.e.a. staat vrij precies uitgelegd in de as dictionary. Even een copy/paste (is een voorbeeld met cfm, maar werkt exact hetzelfde met php):
Create a CFM file in Macromedia Dreamweaver or in your favorite text editor. Add the following text to the file:
<cfif IsDefined("Form")>
<cfmail to="#Form.emailTo#" from="#Form.emailFrom#" subject="#Form.emailSubject#">#Form.emailBody#</cfmail>
&result=true
<cfelse>
&result=false
</cfif>

Save the file as email.cfm, and upload it to your website.
In Flash, create a new document.
Create four input text fields on the Stage, and give them the following instance names: emailFrom_txt, emailTo_txt, emailSubject_txt, and emailBody_txt.
Create a dynamic text field on the Stage with the instance name debug_txt.
Drag a PushButton component instance to the Stage, and give it the instance name submit_btn.
Select Frame 1 in the Timeline, and open the Actions panel (Window > Development Panels > Actions) if it isn’t already open.
Enter the following code in the Actions panel:
this.submit_btn.onRelease = function() {
var emailResponse:LoadVars = new LoadVars();
var email:LoadVars = new LoadVars();
email.emailFrom = emailFrom_txt.text;
email.emailTo = emailTo_txt.text;
email.emailSubject = emailSubject_txt.text;
email.emailBody = emailBody_txt.text;
email.sendAndLoad("http://www.yoursite.com/email.cfm", emailResponse, "POST");
emailResponse.onLoad = function() {
debug_txt.text = this.result;
};
};

This ActionScript creates a new LoadVars object instance, copies the values from the text fields into the instance, and then sends the data to the server. The CFM file sends the e-mail and returns a variable (true or false) to the SWF file called result, which appears in the debug_txt text field.

Note: Remember to change the URL www.yoursite.com to your own domain.

Save the document as sendEmail.fla, and then publish it by selecting File > Publish.
Upload sendEmail.swf to the same directory that contains email.cfm (the ColdFusion file you saved and uploaded in step 2).
View and test the SWF file in a browser.
On complete tutorial schrijven als er al zoveel zijn is een onzinnige bezigheid als we niet weten waar je vastloopt. En verder ben je altijd welkom met je vragen ;)

John

Tijntje
%Europe/Berlin %773 %2005, 19:34
ok, harstikke bedankt.. als ik er niet uitkom hoor je het wel.. (Y)

Tijntje
%Europe/Berlin %452 %2005, 11:52
het is me niet gelukt hoor.. snap er niet egt veel van..
:(

brossiekoppie
%Europe/Berlin %681 %2005, 17:21
Wat snap je niet?

Heb je ervaring met flash/(mysql) db's/php ?