|
Advance using
MSMF can be used with some advance cases which are described below.
- Access Flex component in MSMF
When you want to change properties of Flex component in MSMF
which is not supported in XML file, you can using method
<id of MSMF instance>.getObject(<name
of Flex component in MSMF instance>
For example, you can change background color of TextInput (which could not
be declared in XML file)
<object>
<type>TextInput</type>
<name>txtYourEmail</name>
...
</object> |
with following code (assume myDynamicContactForm is id of MSMF
component instance):
|
myDynamicContactForm.getObject("txtYourEmail").setStyle("backgroundColor","Green"); |
And the result

- Send a copy of mail to customer
There are some components which content can be sent to PHP script
using POST method. The name of these variables corresponding to <name>
property of components which are declared in XML file.
For example, assume that your MSMF is used for Contact form. It
means it should have TextInput component which customer will input
his/her email.
<object>
<type>TextInput</type>
<name>txtYourEmail</name>
...
</object> |
Now you edit PHP script mail_content.php on PHP Server as
following
| $mail_CC = $_POST['txtYourEmail']; |
So each time customer press Send button on your MSMF, one mail
will be sent to you (with email address $mail_to in mail_content.php)
and CC to your customer email. See this in Example4: Send a copy of mail to customer
As said above, because some component values are POSTed to PHP
script (corresponding to name property), they can be used to reformat mail content by replacing default
value of $mail_message_html and $mail_message_plaintext
Following is list of components which will be POSTed to PHP
script
| Component |
Value type |
Meaning |
| TextInput |
String |
Text content |
| TextArea |
String |
| RichTextEditor |
String |
HTML text content |
| CheckBox |
Boolean |
"true"/"false" |
| RadioButton |
Boolean |
| ComboBox |
String |
Text string of current selected item |
| RadioButtonGroup |
String |
Text string of current selected RadioButton
item |
For more details, refer to Example4: Send a copy of mail to customer
Using POSTed value of components, you can use it for other purpose
with PHP programing (send mail is only one of these). For example,
checking account, count result from survey, update database...
Back | Table of Contents | Next
|