Tuesday, 14 June 2011

Every SWF file runs at some unique level. Let us say we
have two swf files namely parentSWF and childSWF, with
childSWF loaded into parentSWF file.

As said, each swf runs at a unique level, assume that
parentSWF is running at _level0 and childSWF is running at
_level1. Therefore, _level0 will refer to the main
timeline of parentSWF and _level1 will refer to the main
timeline of childSWF.

_root will always refer to the maintimeline of its own swf.
In other words, if we say _root in childSWF, it will point
to the maintimeline of childSWF. Similarly, if we say _root
in parentSWF, it will refer to the maintimeline of
parentSWF.

It is therefore important to note that _root and _level0
will only be same if they are being referenced from the swf
file that is running at _level0. Similarly, _root and _leveln
will be same only in the swf that is running at _leveln.

As per the above explanation, if you refer to _root and
_level0 in an swf file that is running at leve5, the _root
will point to the maintimeline of this particular swf
(running at _level5) and _level0 will point to another swf
that is running at _level0.


Note: AS3.0 does not have any level concepts

Hope that helps :)

Sunday, 22 May 2011

Remote Procedure Call (RPC) in Flex - The basic concept

Many people have asked me about RPC (Remote Procedure Call) in Flex. Although, I soon intend to publish a more detailed description about RPC, this is for you to get a basic idea of it. This write up is targeted at beginers only.

So here we go...

The “remote procedure call” architecture:

RPC (Remote Procedure Call) is an architecture wherein a software program in one operating environment can execute functions in another remote operating environment. Flex can participate in different RPC architectures.

RPC architecture typically requires a dynamic web server that responds to complex HTTP requests.

There are three RPC components and all of them communicate to the web server via HTTP protocol. They however pass different message formats between the client and server.

Following are the three RPC components:

a. HTTPService Component:

i. This component can make HTTP requests to any web server environment. It can call both dynamic and static pages.
ii. The message format used is either plain text or XML

b. RemoteObject Component:

This component uses AMF (ActionScript Message Format) to communicate between client and server.

c. WebService Component:

This Component uses SOAP message format to communicate between client and server.

Note*: RemoteObject and WebService components cannot communicate to any web server unlike HTTPService component.
RemoteObject component works only with servers that implement AMF, like ColdFusion, Blaze DS, LiveCycle data services, etc. On the other hand WebService component works with only those servers that support SOAP protocol like ColdFusion, vdzf b ASP.NET, and J2EE.

More to follow soon ;)