Logo

Navigation
  • Home
  • Services
    • ERP Solutions
    • Implementation Solutions
    • Support and Maintenance Solutions
    • Custom Solutions
    • Upgrade Solutions
    • Training and Mentoring
    • Web Solutions
    • Production Support
    • Architecture Designing
    • Independent Validation and Testing Services
    • Infrastructure Management
  • Expertise
    • Microsoft Development Expertise
    • Mobile Development
    • SQL Server Database and BI
    • SAP BI, SAP Hana, SAP BO
    • Oracle and BI
    • Oracle RAC
  • Technical Training
    • Learn Data Management
      • Business Intelligence
      • Data Mining
      • Data Modeling
      • Data Warehousing
      • Disaster Recovery
    • Learn Concepts
      • Application Development
      • Client Server
      • Cloud Computing Tutorials
      • Cluster Computing
      • CRM Tutorial
      • EDI Tutorials
      • ERP Tutorials
      • NLP
      • OOPS
      • Concepts
      • SOA Tutorial
      • Supply Chain
      • Technology Trends
      • UML
      • Virtualization
      • Web 2.0
    • Learn Java
      • JavaScript Tutorial
      • JSP Tutorials
      • J2EE
    • Learn Microsoft
      • MSAS
      • ASP.NET
      • ASP.NET 2.0
      • C Sharp
      • MS Project Training
      • Silverlight
      • SQL Server 2005
      • VB.NET 2005
    • Learn Networking
      • Networking
      • Wireless
    • Learn Oracle
      • Oracle 10g
      • PL/SQL
      • Oracle 11g Tutorials
      • Oracle 9i
      • Oracle Apps
    • Learn Programming
      • Ajax Tutorial
      • C Language
      • C++ Tutorials
      • CSS Tutorial
      • CSS3 Tutorial
      • JavaScript Tutorial
      • jQuery Tutorial
      • MainFrame
      • PHP Tutorial
      • VBScript Tutorial
      • XML Tutorial
    • Learn Software Testing
      • Software Testing Types
      • SQA
      • Testing
  • Career Training
    • Career Improvement
      • Career Articles
      • Certification Articles
      • Conflict Management
      • Core Skills
      • Decision Making
      • Entrepreneurship
      • Goal Setting
      • Life Skills
      • Performance Development
      • Personal Excellence
      • Personality Development
      • Problem Solving
      • Relationship Management
      • Self Confidence
      • Self Supervision
      • Social Networking
      • Strategic Planning
      • Time Management
    • Education Help
      • Career Tracks
      • Essay Writing
      • Internship Tips
      • Online Education
      • Scholarships
      • Student Loans
    • Managerial Skills
      • Business Communication
      • Business Networking
      • Facilitator Skills
      • Managing Change
      • Marketing Management
      • Meeting Management
      • Process Management
      • Project Management
      • Project Management Life Cycle
      • Project Management Process
      • Project Risk Management
      • Relationship Management
      • Task Management
      • Team Building
      • Virtual Team Management
    • Essential Life Skills
      • Anger Management
      • Anxiety Management
      • Attitude Development
      • Coaching and Mentoring
      • Emotional Intelligence
      • Stress Management
      • Positive Thinking
    • Communication Skills
      • Conversation Skills
      • Cross Culture Competence
      • English Vocabulary
      • Listening Skills
      • Public Speaking Skills
      • Questioning Skills
    • Soft Skills
      • Assertive Skills
      • Influence Skills
      • Leadership Skills
      • Memory Skills
      • People Skills
      • Presentation Skills
    • Finding a Job
      • Etiquette Tips
      • Group Discussions
      • HR Interviews
      • Interview Notes
      • Job Search Tips
      • Resume Tips
      • Sample Resumes
 

Working with XML in Flash

By Exforsys | on August 30, 2007 |
XML Tutorial

Working with XML in Flash

To integrate an XML document with Flash, we need an XML document that works with Flash, one that can set up the visual movements of the action movie and define the script that will be used for the code of the action movie.

How do We Integrate XML and Macromedia Flash?

IMEX stands for Imaginary Macromedia Exchange, and IMEX is also a client server application. There has to be a protocol to interact between the client and the server. The protocol must also be designed in such a way that it fulfills all the requirements of the system.

However, for information to be traded in IMEX, there are some prior requirements which have to be fulfilled like the information that is being transmitted must be secure, and all user accounts that will be used must be protected by a password, and users need to have access to their portfolio and all the information provided must be current. In addition to this, users should be able to carry out commercial transactions using the IMEX securities.

Flash supports XML data transfers, but IMEX cannot support real time trading so for this purpose the HTTP based XML support for data is used.

How is Data Transmitted Safely?

Based on the very first requirement of the IMEX server, the data must be transmitted in hypertext transfer protocol safely and securely. Usually URL’s or Universal Resource Identifiers while playing a Flash movie will have HTTPs instead of HTTP because it means the data is secure. The IMEX servers should be capable of handling HTTPs requests for the data to be transferred through these servers.

Coming to the second condition, which is the password protection clause, every user needs to have a user name and password. The server will also have a database of passwords and usernames which will be authenticated as and when needed, for which the Flash movie will ask before it plays the movie. Once the user enters the login information, then the movie transmits that information to the XML server.

The login element however is not a predetermined value, and the XML document lets it create XML elements which are specific to the application. The protocol that will be used to carry out all these transactions is called the IMEX XML, and is an application based on XML which has specific XML elements. and they are designed especially for IMEX. Only when the password is accepted can the server respond, otherwise it returns a null value.

If the password is rejected then the server returns a login failed message. Every login session creates a session ID which will be used between the client server through out the session, and as long as the session lasts.

Coming to the third requirement, the IMEX server of users must be allowed to access current information about their portfolio, since this information is stored on the server and the Flash movie has to download this information. Once the user requests the Flash movie to be downloaded, or the portfolio information, the Flash movie transfers this request to XML. After this process the server comes back with a response with an XML element which contains portfolio information and more elements which are holding.

The fourth requirement is to trade securities. The user will enter one or more transactions of buy or sell into the Flash movie, and the movie forwards it to XML as a transaction. This transaction may contain one or more buy and sell activities. Each transaction element can have more than one trade element. To confirm the transaction, the server returns the value as a transaction reply element.

How are Visual Elements Handled?

Flash is probably one of the easiest software programs to handle. To create a flash movie all you have to do is open and click on "create movie" and provide everything required. For visual elements we need dynamic text fields.

Everything else depends on the action script, which is the key element for bringing in the XML into a flash movie. The first thing we would do is to tell Flash that XML will be used in the movie. What is done here is that a variable is created inside the flash movie which is of XML to understand the XML which will be integrated with the movie. The variable headline will have properties which can identify a XML document.

The next step is to load the XML document. A variable called the variable headline is used to associate the script, and the program which will be used to run the script. The correct path to the XML file is written in the headline. If flash is not able to find this path then the movie will not play.

So it is very important that flash find this path to play the movie. Finally, to check if everything is correct in the program, the only way to validate is if the flash movie is playing. If the movie plays then the visual elements have been handled well and also correctly. It also means that the published variable can be executed.

What is the Publish Variable?

The main function of the published variable is to parse the content from the XML document. The flash software examines the relationship to see where the content appears within a specified tag. XML data is usually grouped with other data, having a sort of parent child relationship.

Elaborately one field will be the main tag for the entire documents which will be dependant on the main tag, and the main tag which is the Broadcast tag is the parent here.

How do we load XML into Flash?

While loading a XML document into Flash, the important thing to figure out is how we load the document, and what commands need to be given so that the document gets loaded successfully. There are two main functions which can be spoken of while loading a XML document into Flash. One would be a function which will already be present, and which will probably need to be called on its own.

The other is the callback function. The call back function has to be defined by you, and should be able to respond when called by Flash and when such circumstances arise that require this function to be called.

In XML the Event is Called the Onload Event

All these functions are used in XML. The XML instances are created by using the class and object, and a construct element in flash that helps you manage XML. If XML has to work in Flash then the XML instances have to be used. So first of all before loading an XML into flash, an XML instance has to be created in Flash. While creating an XML instance there is an option where you can pass the XML string to the XML constructor. This string will have an XML which will be defined with the XML instance that has been created.

Once you have successfully defined the instance, then you can define the onload and callback functions. The callback function always has to be made onload. Using this decides when to call for a callback function, and that is after the XML content is loaded and parsed. In addition to this, a success element is also passed into the document which will pass if the loading has been successful. This will let you know if XML has been loaded or not.

XML has to load in flash and this process cannot be immediate, and it also takes time. Sometimes several seconds translate to Flash frames before XML is accessible to the XML instance. This also means that an attempt to access information within the same script while loading will be a failure.

That is if this whole process occurs in a single onload function. An onload function is usually defined in the same script like everything else, and also this onload function is not called upon unless XML is fully loaded and parsed. The onload function does everything you need to do with your XML document to be loaded.

Even if you want to populate the menu, you can do it on the onload. You can also display a family tree on the onload. The onload plays a key role in handling XML documents since it is then you have actual access to the XML document.

Preloaders can also be created for XML. Though they are not needed, it is good to know this information because there are some really huge files which you may have to load, and in those circumstances preloaders do come in handy. Making a preloader for XML is very similar to making a preloader for JPEG.

The only difference here is that instead of calling the getbytes from getbytes movie clip, you will be calling for this information from a XML instance. So preloaders for a movie can be created using a XML reference to the XML object. Whether it is a movie clip which is being played, or an XML instance, if the get bytes total and the get bytes loaded functions work, then it is sufficient.

« « Working with XML in Oracle
Building Better Supply Chain » »

Author Description

Avatar

Editorial Team at Exforsys is a team of IT Consulting and Training team led by Chandra Vennapoosa.

Free Training

RSSSubscribe 401 Followers
  • Popular
  • Recent
  • XML Advantages

    July 5, 2007 - 0 Comment
  • Working with XML in Visual Basic

    August 28, 2007 - 0 Comment
  • XML Disadvantages

    July 8, 2007 - 0 Comment
  • Working with XML in Oracle

    August 30, 2007 - 0 Comment
  • XML Web Services

    July 11, 2007 - 0 Comment
  • XML Parsing

    July 14, 2007 - 0 Comment
  • XML Introduction

    May 14, 2006 - 0 Comment
  • XML Processing

    July 16, 2007 - 0 Comment
  • XML – Elements, Attributes, Entities

    May 14, 2006 - 0 Comment
  • XML Remote Calling Procedure

    July 19, 2007 - 0 Comment
  • Working with XML in C

    September 7, 2007 - 0 Comment
  • Working with XML in Perl

    September 6, 2007 - 0 Comment
  • Working with XML in Python

    September 2, 2007 - 0 Comment
  • Working with XML in Oracle

    August 30, 2007 - 0 Comment
  • Working with XML in Visual Basic

    August 28, 2007 - 0 Comment
  • Using XML with Microsoft Excel

    August 24, 2007 - 0 Comment
  • XML Spy

    August 24, 2007 - 0 Comment
  • XML and Service Oriented Architecture

    July 25, 2007 - 0 Comment
  • XML SQL Server

    July 23, 2007 - 0 Comment
  • XML Security

    July 21, 2007 - 0 Comment

Exforsys e-Newsletter

ebook
 

Related Articles

  • Working with XML in C
  • Working with XML in Perl
  • Working with XML in Python
  • Working with XML in Oracle
  • Working with XML in Visual Basic

Latest Articles

  • Project Management Techniques
  • Product Development Best Practices
  • Importance of Quality Data Management
  • How to Maximize Quality Assurance
  • Utilizing Effective Quality Assurance Strategies
  • Sitemap
  • Privacy Policy
  • DMCA
  • Trademark Information
  • Contact Us
© 2022. All Rights Reserved.IT Training and Consulting
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.Accept Reject Read More
Privacy & Cookies Policy
Necessary Always Enabled