Flash Remoting From CF - PowerPoint PPT Presentation

About This Presentation
Title:

Flash Remoting From CF

Description:

Demonstrating the development of a small Flash MX application ... { var fooValue = pullDownMenu.getValue(); fooMember.GetGroup ... var fooIndex = menuGroup. ... – PowerPoint PPT presentation

Number of Views:26
Avg rating:3.0/5.0
Slides: 13
Provided by: rogerk9
Category:
Tags: flash | remoting | var

less

Transcript and Presenter's Notes

Title: Flash Remoting From CF


1
Flash Remoting From CF
  • Using ColdFusion MX and Flash MX to create an
    efficient and user friendly interface.

2
Rich User Interface
  • Demonstrating the development of a small Flash MX
    application that uses CFMX back-end to pull
    information from a Database

3
What we will be using.
  • ColdFusion Compontents
  • Flash Remoting
  • ActionScript

4
Software Review and Setup
  • ColdFusion MX Server
  • Flash MX
  • Flash Remoting Components
  • Test Flash Remoting Gateway

5
Example Application
  1. Set up Data Base
  2. Program ColdFusion Component
  3. Test Flash Remoting Gateway
  4. Add Flash Components and Functions

6
CF Component
  • ltcfcomponent hint"All functions for Member List
    Application"gt
  • ltcffunction access"remote" name"GetDivision"
    returntype"query"gt
  • ltcfquery name"GetDivision datasource"members
    "gt
  • Select distinct division
  • from members
  • Order by division
  • lt/cfquerygt
  • ltcfreturn GetDivisiongt
  • lt/cffunctiongt
  • lt/cfcomponentgt

7
Initialize Flash Gateway
  • include "NetServices.as"
  • include "DataGlue.as"
  • include "NetDebug.as"
  • ftnInit function ()
  • if (this.inited ! undefined)
  • return
  • else
  • this.inited true
  • NetServices.setDefaultGatewayUrl("http//localho
    st8500/flashservices/gateway/")
  • gatewayConnnection NetServices.createGatewayCo
    nnection()
  • fooMember gatewayConnnection.getService("membe
    r.memberlist", this)
  • dataForServer new Object()
  • trace("Gateway Initialized")
  • ftnInit()

8
Add Flash Component (pullDownMenu)
  • Add Flash Component (combo box)
  • Name it pullDownMenu
  • Add function
  • ftnGetDivision function()
  • fooMember.GetDivision()
  • trace("GetDivision Ran")
  • this.onResult function(dataFromServer)
  • var itemToAdd division "Select Division"
  • dataFromServer.addItemAt(0, itemToAdd)
  • DataGlue.BindFormatStrings(pullDownMenu,
    dataFromServer, "division", "division")
  • Result set is added to pullDownMenu

9
Add ListBox
  • ftnGetGroup function()
  • var fooValue pullDownMenu.getValue()
  • fooMember.GetGroup(fooValue)
  • trace("Got a Member" fooValue)
  • this.onResult function(dataFromServer)
  • trace("yes")
  • trace(dataFromServer.getLength())
  • DataGlue.BindFormatStrings(menuGroup,
    dataFromServer, "LastName, FirstName",
    "id")

10
Add Text Boxes
  • Add Label Text
  • Add Dynamic Text Box
  • Assign Variable Name
  • Assign as Input Text
  • Align and Format

11
Function to populate TextBox
  • ftnGetIndividual function()
  • trace(menuGroup.getSelectedIndex())
  • trace(_global.myRecord.getColumnNames())
  • var fooIndex menuGroup.getSelectedIndex()
  • _root.txtFirstName _global.myRecord.itemsfooIn
    dex.FirstName
  • _root.txtLastName _global.myRecord.itemsfooInd
    ex.LastName
  • _root.txtDivision _global.myRecord.itemsfooInd
    ex.Division
  • _root.txtEmail _global.myRecord.itemsfooIndex
    .Email
  • ftnClearAll function()
  • _root.txtFirstName ""
  • _root.txtLastName ""
  • _root.txtDivision ""
  • _root.txtEmail ""

12
Application ExamplesQuestions
Write a Comment
User Comments (0)
About PowerShow.com