Blueprint is a plugin for Adobe® Flex® Builder™ 3 and Flash® Builder™ 4 that allows users to query for Adobe Flex and Adobe Flash code examples found on the Web directly inside of the development environment.
Give it a try http://labs.adobe.com/technologies/blueprint/
Wednesday, 6 October 2010
Tuesday, 27 April 2010
ErrorTestUtils
package domain.utils
{
public class ErrorTestUtils
{
public function ErrorTestUtils()
{
}
public static function isErrorThrown(callMethodThatCausesError:Function,errorReport:String,args:Array):Boolean
{
var errorThrown:Boolean = false;
try
{
callMethodThatCausesError.apply(null,args);
}
catch(e:Error)
{
errorThrown = (e.message == errorReport)
}
return errorThrown;
}
}
}
Testing Thrown Error Handling
A quick way to test thrown errors are behaving as expected.[Test]
public function testErrorHandling():void
{
var errorThrown:Boolean = false;
try
{
callMethodThatCausesError();
}
catch (e:Error)
{
errorThrown = (e.message == 'SomeClass.ERROR_IN_DATA_MESSAGE');
}
assertTrue(errorThrown);
}
public function testErrorHandling():void
{
var errorThrown:Boolean = false;
try
{
callMethodThatCausesError();
}
catch (e:Error)
{
errorThrown = (e.message == 'SomeClass.ERROR_IN_DATA_MESSAGE');
}
assertTrue(errorThrown);
}
Doc File Import Folder So you can move asdocs from pc to pc.
C:\Documents and Settings\Lyndon Fasanya\Application Data\Doc.EE57A57224685151543546B0367A0BD876BF88FF.1\Local Store
Saturday, 24 April 2010
Improving application performance.
Ways to improve app performance!!!!
- Introduction
- Architecting Flex Applications That Perform Well
- A Note About Flash Players
- Using Layouts, Hierarchy, and Containment Properly
- Using Deferred Instantiation to Improve Perceived Performance
- Handling Large Data Sets
- Playing Complex Effects Smoothly
- Achieving Great Performance with Runtime Styles
- Using Dynamically Repeating Controls for Better Performance
Sent from my iPhone
Tuesday, 20 April 2010
Channels endpoints and destinations, AIR and Flex, courtesy of weborb and midnightcoders
Endpoint - this is the URL where AIR/Flex app sends remoting/messaging requests to Channel - a concept encapsulating the endpoint. Also identifies classes managing the channel on both client and server sides Destination - identifies a server-side class exposed by WebORB. Used by Flex/AIR client to target method invocations against the referenced class. Channels are configured in WEB-INF/flex/services-config.xml (and
weborb-services-config.xml if present in your system). Every channel has the "endpoint" element. For example, you have the following
channel definition: <channel-definition id="my-amf"
class="mx.messaging.channels.AMFChannel">
<endpoint uri="weborb.php"
class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<polling-enabled>false</polling-enabled>
</properties>
</channel-definition> Notice the following line: <endpoint uri="weborb.php" "weborb.php" here is actually a URL. The reason it does not look like a URL is because it is relative. If your Flex app is loaded from http://myhost/foo/AwesomeApp.html then your application will be sending remoting requests to the following URL: http://myhost/foo/weborb.php (This is the reason why WebORB for PHP requires that you put weborb.php into the same directory containing your SWF.) So how does the client know what channel to use. The answer lies in remoting-config.xml. This is where all the destinations are defined.
Most of the destinations do not explicitly reference the channels. For those, there's a special declaration at the top that establishes the default channel: <default-channels>
<channel ref="my-amf"/>
</default-channels> As a result, when you create a RemoteObject to talk to GenericDestination, remoting requests will be sent to the endpoint defined in the my-amf channel. Now, suppose you need to get AIR to talk to WebORB. Obviously the my-amf channel will not work for you since the endpoint is relative.
You can definitely change the endpoint to be an absolute URL and it will solve the problem. Alternatively, take a look at the channel with
the following ID: my-air-amf Notice the endpoint URL for that channel is absolute. Now take a look at the GenericAIRDestination destination in remoting-config.xml. You will see it references the my-air-amf channel. As a result, if your
AIR application uses "GenericAIRDestination", your AIR client will talk to WebORB and send remoting requests to the endpoint URL from the
my-air-amf channel. It is important to adjust the URL to reflect the location of your WebORB instance.
weborb-services-config.xml if present in your system). Every channel has the "endpoint" element. For example, you have the following
channel definition: <channel-definition id="my-amf"
class="mx.messaging.channels.AMFChannel">
<endpoint uri="weborb.php"
class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<polling-enabled>false</polling-enabled>
</properties>
</channel-definition> Notice the following line: <endpoint uri="weborb.php" "weborb.php" here is actually a URL. The reason it does not look like a URL is because it is relative. If your Flex app is loaded from http://myhost/foo/AwesomeApp.html then your application will be sending remoting requests to the following URL: http://myhost/foo/weborb.php (This is the reason why WebORB for PHP requires that you put weborb.php into the same directory containing your SWF.) So how does the client know what channel to use. The answer lies in remoting-config.xml. This is where all the destinations are defined.
Most of the destinations do not explicitly reference the channels. For those, there's a special declaration at the top that establishes the default channel: <default-channels>
<channel ref="my-amf"/>
</default-channels> As a result, when you create a RemoteObject to talk to GenericDestination, remoting requests will be sent to the endpoint defined in the my-amf channel. Now, suppose you need to get AIR to talk to WebORB. Obviously the my-amf channel will not work for you since the endpoint is relative.
You can definitely change the endpoint to be an absolute URL and it will solve the problem. Alternatively, take a look at the channel with
the following ID: my-air-amf Notice the endpoint URL for that channel is absolute. Now take a look at the GenericAIRDestination destination in remoting-config.xml. You will see it references the my-air-amf channel. As a result, if your
AIR application uses "GenericAIRDestination", your AIR client will talk to WebORB and send remoting requests to the endpoint URL from the
my-air-amf channel. It is important to adjust the URL to reflect the location of your WebORB instance.
Thursday, 15 April 2010
Using Enterprise Architect to create a Class Model from an AS project.
1. Open EA the application.
2. From the app (if plugin in Eclipse select the Enterprise Architect option then ) Create a New Project.
3. Navigate to where you want your project to placed.
4. Your Project Browser perspective should be open and you'll see a tab called Model this is the project you've just created a project is a collection models in EA. Select it.
5. Right Click on this and select 'Add a new model' using wizard.
6. Check the class model box. and Ok this, a class model icon will appear under the model icon in your project.
7. Right Click on the Class Model folder looking icon (not the blue one).
8. Mouse Over Code Engineering and select 'Import Source Directory'.
9. In the dialog box select ActionScript ensure file extension are .as and the options you prefer
10. Choose the Root Directory you want to generate a Class Model for.11. To generate rtf documentation select the icon 4th from right on the toolbar with OR select F8 it looks like lines with ticks and crosses although there are two of them.
2. From the app (if plugin in Eclipse select the Enterprise Architect option then ) Create a New Project.
3. Navigate to where you want your project to placed.
4. Your Project Browser perspective should be open and you'll see a tab called Model this is the project you've just created a project is a collection models in EA. Select it.
5. Right Click on this and select 'Add a new model' using wizard.
6. Check the class model box. and Ok this, a class model icon will appear under the model icon in your project.
7. Right Click on the Class Model folder looking icon (not the blue one).
8. Mouse Over Code Engineering and select 'Import Source Directory'.
9. In the dialog box select ActionScript ensure file extension are .as and the options you prefer
10. Choose the Root Directory you want to generate a Class Model for.11. To generate rtf documentation select the icon 4th from right on the toolbar with OR select F8 it looks like lines with ticks and crosses although there are two of them.
Subscribe to:
Posts (Atom)