Flash
  Home arrow Flash arrow Page 6 - Flexing the Flash Review
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
FLASH

Flexing the Flash Review
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 9
    2006-06-06

    Table of Contents:
  • Flexing the Flash Review
  • My first Project with Flex Builder2
  • Create a new project
  • The NewFlex Project
  • Some hands-on experiments
  • How do you make changes to the MXML source code?

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Flexing the Flash Review - How do you make changes to the MXML source code?


    (Page 6 of 6 )

    Well, here you have a countless number of possibilities. You can add style, scripts, and more. Here is a modified MXML file which changes the label's text content as well as its style. When the button is clicked the text changes.

    The various methods and properties are available as soon as you place your cursor after one of the attributes as shown in this picture. For example,  if you move the cursor by one space after "Button," a drop-down pops up with a number of items from which you can choose.  Choose the click event from the drop-down menu (it is assumed you have also added a button). To the click event add the function to be called clr1().

    How do you add script and style?

    Previously, a click event was defined which says, when the button is clicked run the function clr1(). The function clr1() is as shown in the code here. Since this file has to conform to XML standards, the CDATA[[]] decoration for the public function clr1() is needed. This is automatically created as soon as you create the script. The function is enclosed in between <mx:script/> tags. The statements in  this function will be called when the button is clicked. The first statement changes the label's text to "This is fantastic" and the second statement calls the styleName called xx. The styleName is the class name of the label, which is defined in turn within the <mx:style/> tags. The final MXML file is shown in the next picture.

    <mx:Script>
    <![CDATA[
    public function clr1(){
    lb1.text="This is fantastic";
    lb1.styleName="xx"
    }
    ]]>
    </mx:Script>
    

    Browser Display

    The two following pictures do not need any explanation. The button click on the first page changes its text as well as its color.

    Before button click:

    After button click:

    Summary

    As discussed in the introduction, dynamic web pages which are browser agnostic will be one of the key requirements of future web applications, and the Flex Builder framework has all the features which can make it a strong competitor in this area, especially with its strong Flash support. The IDE is built on top of the Eclipse platform, and can port in all the developments made in that project. Help for Adobe Flex Builder uses the Eclipse Help system. It is somewhat slow in getting all the related material, but once search results are aggregated the access is very fast. The online documentation is excellent. It has all the attributes of cutting edge RAD software to create web applications. Go, Flex your Flash!.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · The tutorial was written when Flex2 was in beta 1. Now it is in Beta 3, but the same...
     

    FLASH ARTICLES

    - Decorator Pattern
    - Organizing Frames and Layers for Flash Anima...
    - Organizing Frames and Layers
    - Using XML and ActionScript with Flex Applica...
    - Interfaces and Events with ActionScript and ...
    - Manipulating Data with ActionScript in Flex ...
    - ActionScript Syntax for Flex Applications
    - ActionScript in Flex Applications
    - A Closer Look at Apollo`s File System API
    - Using the File System API
    - ActionScript 101
    - Flash Buttons
    - Advanced Flash Animation
    - Creating Your First Animated Movie with Flas...
    - Flash: Building Blocks






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT