Archive for the 'SWX ActionScript Library' Category

Why am I getting Security Sandbox Violations in the Flash IDE when running the sample applications or my own applications?

Summary: This warning only occurs when testing your applications from the Flash IDE. Cross-domain data exchange will work correctly when you run your applications from a web server. You can ignore this warning.

SWX RPC lets you to make cross-domain data calls (you can turn this off by setting the allowDomain option in the SWX PHP configuration file at php/swx_config.php to false). This means, for example. that you can have a SWF running on your development server or on your shared host somewhere and you can still consume the SWX RPC services (APIs) on the Public SWX Gateway on swxformat.org.

The Flash IDE, however, will display a Security Sandbox Violation when you run SWX applications in the IDE. This is because applications that run in the IDE use the file:// protocol as opposed to http://. Rest assured that your applications will work correctly when tested from a web server using the http:// protocol.

In short, you can safely ignore this warning.

For a longer explanation, read on.

The way SWX RPC enables cross-domain data exchange is by writing an allowDomain statement to the exact URL of the SWF that called it (your application) in the SWX data SWF that it sends back. The SWX ActionScript Library sends this URL in the SWX RPC call for you.

If you are using the native method via loadMovie(), you need to send the value of _url in a parameter called url in your SWX RPC call manually. Alternatively, when using the native method, if you don't send a url parameter, you can specifically allowDomain the loaded SWX data SWF from the main application and it, in turn, it will allowDomain its parent (your application) if it doesn't receive the url. This second method is discouraged, however, as the SWX data SWF should not require access to your application (if only does so to allow your application access to itself by calling allowDomain on _parent) and a fake SWX data SWF from an untrusted SWX RPC gateway could possibly access data and/or alter your main application when using this method.

To summarize, you can ignore this warning and you should either send a url parameter when using the native method via loadMovie() in SWX RPC or, even simpler, use the SWX ActionScript Library when your applications need to access data across domains.


generic paxil

christina ricci prozac nation

imitrex nasal spray

carisoprodol href

prozac

crestor

diflucan online

cialis compare levitra

cheap prednisone

phentermine no prescription

doxazosin 4 mg

celebrex canadian

paxil on line

prosac

effexor tablets

tramadol online

online pharmacy tramadol

levitra blog

herbal hoodia phentermine

lipator

diflucan 1

buy rimonabant

imitrex patent

crestor

diflucan 1

emea rimonabant

fluconazole diflucan

buy carisoprodol cheap online

buy cialis link

discount paxil

generic levitra online

order proscar

rimonabant

clonidine prescription

cheap proscar

imitrex online

purchase rimonabant

buy proscar

furosemide and digoxin

buy proscar

natural viagra

diflucan online

stopping prednisone

lipitor side effects

buy carisoprodol

proscar drug

generic imitrex

effexor antidepressant

buy carisoprodol

lipitor uk

SWX PHP and SWX ActionScript Library Version 1.0 Released

SWX PHP 1.0 and SWX ActionScript Library 1.0 Release Announcement

It's my great pleasure to announce that after six months of alphas and betas, SWX PHP 1.0 and SWX ActionScript Library 1.0 are now available for download.

The major changes from SWX PHP Release Candidate 1 include a revamped Start Page with new, royalty-free icons, and a friendly new list view for the Services and Flash examples folders.

I've also updated the SWX Nabaztag API so that you can now specify the voice that you want your Nabaztag bunny to talk in and you can move its ears and send it ear and LED choreographies. You can test out and use the SWX Nabaztag API and the other SWX APIs (Flickr, Twitter, etc.) directly from the Public SWX Gateway using the SWX Service Explorer.

Finally, there's a new LOG_ALL configuration option in swx_config.php that determines whether non-error (status, info, profiling) messages are written to the PHP error log. Set this to false on deployments for better performance. The setting defaults to true as it is useful for troubleshooting during development.

Update: Based on Jon MacDonald's suggestion (thanks, Jon!), I've also created a SWX PHP Deployment Bundle to make it easier for you to deploy SWX PHP to your server. Use the regular SWX PHP and SWX PHP MAMP Bundles to develop with and then deploy the lean-and-mean deployment bundle to your server. The deployment bundle is much smaller than the regular build as it doesn't contain the source code for the Flex-based tools or the sample Flash FLA files.

The release of SWX PHP 1.0 and SWX ActionScript Library 1.0 is something I've been looking forward to for quite a while now and I hope that SWX simplifies your development life and makes it as fun for you to create Flash and Flash Lite applications and mashups as it has for me.

In the next two months, I'm going to be traveling around the world to talk about SWX at FlashForward Boston, FlashForum Conference in Germany, MAX Chicago, MAX Barcelona, FITC Hollwood, MAX Japan, and Flash on the Beach in my home town of Brighton, in the UK. In addition to this, development work continues (I just made my first post-1.0 commit to the SVN repository) and will include efforts to create a Flash 9 version of SWX PHP, as well as SWX RPC implementations for Ruby, Python, J2EE, and .Net.

In the next few days, I will be releasing Internet Drafts for SWX and SWX RPC which I hope will become Informational RFCs.

Here's to Version 1.0! This is just the beginning.

Read the full release notes for SWX PHP 1.0 and download the 1.0 release.


effexor weight

lipitor and grapefruit

generic viagra

phentermine 37.5 mg

oral prednisone

imitrex

paxil online

paxil medication

proscar finasteride

kamagra oral jelly

cheap levitra online

crestor tablets

furosemide dose

order phentermine

cost levitra

proscar for hair loss

doctor lipitor vs zocor

buy neurontin

buy celebrex online

digoxin action

phentermine diet

side effects of furosemide

furosemide renal

ultram tramadol

celebrex medicine

dose of prednisone

melphalan prednisone

buy neurontin online

fluoxetine prozac

prozac alcohol

cheap rimonabant

venlafaxine

phentermine prescription

effexor tablets

viagra side effects

side effects of prednisone

diflucan side effects

lipitor side effect

buy cialis

proscar hair

effexor 37.5 mg

10 levitra

rimonabant smoking

prednisone in dogs

buy effexor

buy cheap cialis online

viagra for women

fluconazole diflucan

discount paxil

crestor meteor

SWX PHP and SWX ActionScript Library Release Candidate 1 Released

I just released Release Candidate 1 (RC1) of SWX PHP and the SWX ActionScript Library. The SWX PHP MAMP Bundle has also been updated to RC1. Get them now from the download page.

There is a whole slew of changes in this update and you can find the whole list in the release notes for SWX PHP RC1.

One of the major changes is that SWX RPC calls can now return simple data types as opposed to the previous behavior which was to wrap simple data types in an array. This may break your existing applications, so please read these instructions for updating your SWX applications to SWX PHP RC1.

Among the highlights of the RC1 release is the release of the SWX Flickr API, which has been available on the Public SWX Gateway for a little while now. The SWX Flickr API implements the full Flickr API and has some additional utility methods that make it the easiest way to work with Flickr in Flash. Take a look at the miniflickr Flash Lite sample application that comes with this release to learn how to work with the new Flickr API as well as some of the advanced features of the SWX ActionScript Library like the ExternalAsset and LoadManager classes.

SWX PHP RC1 has two more new APIs: The Jaiku API and Numpa API (Numpa is the Netherlands version of Twitter), both by my dear friend Folkert Hielema. You can find Folkert's other SWX-related work, as well as the work of other community members, in the new SWX Showcase.

You can explore and test all of the SWX APIs online using the SWX Service Explorer.

The SWX Data Analyzer has also been updated and now supports the display of simple data types correctly. It also displays debug information in a clearer manner.

With the RC1 release, the SWX ActionScript Library is available as a separate download. This means that if you don't want to write your own server-side classes, you don't have to download the full SWX PHP package just to use the high-level ActionScript classes.

Unless there are any major issues discovered in the next few days, Release Candidate 1 is going to be very close to the final release version of SWX PHP and the SWX ActionScript Library. If you do notice any issues, please report them to me. SWX PHP is now in feature freeze and only critical bugs will be fixed at this point (no new feature requests, etc.) In the next few days, I'm going to be updating the documentation, making some aesthetic changes, and recording more screencasts to prepare SWX PHP for the Version 1.0 release next week.

We're very close to Version 1.0, and that's just the beginning! :)


phentermine on line

digoxin interaction

commercial levitra

buy phentermine online

viagra online

celebrex coumadin

buy carisoprodol diazepam online soma

furosemide and digoxin

rimonabant depression

side effects of furosemide

effects hoodia plant side

doctor lipitor vs zocor

carisoprodol medicine

rimonabant 20mg

buy crestor online

lipitor atorvastatin

side effects of furosemide

order neurontin

cheap effexor

iv furosemide

melphalan prednisone

venlafaxine effexor

bumetanide furosemide

free levitra

slimciti hoodia

digoxin levels

buy proscar

cheap levitra online

crestor canada

proscar medication

buy lipitor online

paxil attorney

buy cheap levitra online

kamagra oral jelly

digoxin interactions

generic prozac

cheap viagra

crestor

celebrex capsules

prednisone

doctor lipitor vs zocor

generic tramadol

carisoprodol href

side effects of proscar

discount lipitor

crestor info

proscar online

cheapest tramadol

effexor 37.5 mg

proscar uk

SWX instance: how to set a fault handler

The SWX class also provides a fault handler that you can use to handler errors during SWX RPC calls. To test it out, modify your code so that it matches the listing below:

import org.swxformat.SWX;
 
var swx:SWX = new SWX();
swx.gateway = "http://localhost:8888/php/swx.php";
swx.encoding = "GET";
swx.debug = true;
swx.timeout = 2; // seconds
 
var callParameters:Object =
{
    serviceClass: "Calculator",
    method: "addNumbers",
    args: [35, 7],
    result: [this, resultHandler],
    timeout: [this, timeoutHandler],
    fault: [this, faultHandler]
}
 
swx.call(callParameters);
 
function resultHandler(event:Object)
{
    status.text = event.result;
}
 
function timeoutHandler()
{
    status.text = "Call timed out!";
}
 
function faultHandler(event:Object)
{
    status.text = event.fault.message;
}

And modify your class so that it generates an error:

<?php
    class Calculator
    {
        function addNumbers($n1, $n2)
        {
            return $n3; // $n3 does not exist!
        }
    }
?>

Test your FLA and you should get something along the lines of Error 8: Undefined variable: n3 in /htdocs/swx/trunk/php/services/Calculator.php, line 7 in the status text field in Flash.

The fault handler also returns API-specific fault codes (e.g., Flickr API error codes) back to Flash.

SWX instance: how to set a timeout handler

You can also specify a timeout handler for your SWX instance to handle calls that take too long to return a result.

Modify the listing so that it matches the one below:

import org.swxformat.SWX;
 
var swx:SWX = new SWX();
swx.gateway = "http://localhost:8888/php/swx.php";
swx.encoding = "GET";
swx.debug = true;
swx.timeout = 2; // seconds
 
var callParameters:Object =
{
    serviceClass: "Calculator",
    method: "addNumbers",
    args: [35, 7],
    result: [this, resultHandler],
    timeout: [this, timeoutHandler]
}
 
swx.call(callParameters);
 
function resultHandler(event:Object)
{
    status.text = event.result;
}
 
function timeoutHandler()
{
    status.text = "Call timed out!";
}

The default timeout duration is 30 seconds but you can override that, as shown here.

In order to make the call actually time out, modify the Calculator class in PHP too to make it sleep for 10 seconds before returning the result. The Calculator class should match the one in the listing below:

<?php
class Calculator
{
    function addNumbers($n1, $n2)
    {
        sleep(10); // Make the call time out!
        return $n1 + $n2;
    }
}
?>

Now test your Flash movie and, after two seconds, you should see the SWX call time out. Timed-out calls are cancelled and will not trigger the result handler at any point in the future.

Instantiating the SWX class

Ideally, you should not have to manually create movie clips and work with low-level native constructs like loadMovie() when working with SWX RPC on a daily basis. The SWX ActionScript Library gives you an abstract, high-level interface for working with SWX RPC.

To use this high-level interface, you need to instantiate the SWX class.

Modify the code listing so that it matches the one below:

import org.swxformat.SWX;
 
var swx:SWX = new SWX();
swx.gateway = "http://localhost:8888/php/swx.php";
swx.encoding = "GET";
swx.debug = true;
 
var callParameters:Object =
{
    serviceClass: "Calculator",
    method: "addNumbers",
    args: [35, 7],
    result: [this, resultHandler]
}
 
swx.call(callParameters);
 
function resultHandler(event:Object)
{
    status.text = event.result;
}

When you run the above example, you should again see 42 in the status text field. Let's look at what has changed.

The biggest change is that you are actually instantiating the SWX class and setting certain properties there (such as the gateway URL, encoding method and whether you want debug information for calls).

Instead of putting call-related parameters directly into a movie clip (you can delete the dataHolder movie clip now as you aren't using it any more), you create a callParameters object and specify the serviceClass, method, and args properties there. But you can do more, you can also specify a result handler that will get called once the data has loaded.

The result handler receives an event object as an argument. That event object has a result property that points to the loaded data.

SWX ActionScript Library: using the prepare() method of the SWX class

When working with SWX RPC, you don't want to continuously serialize complex arguments by hand when call server-side methods. And you don't have to, if you use the prepare() method of the SWX class in the SWX ActionScript Library that comes with SWX PHP.

Save your FLA in the flash/ folder (the one that has the org and com folders) before continuing. (Or add that folder to your ActionScript classpath in the Flash IDE and save your FLA anywhere.)

Modify the code sample so that it matches the listing below:

import org.swxformat.SWX;
 
dataHolder.serviceClass = "Calculator";
dataHolder.method = "addNumbers";
dataHolder.args = [35, 7];
dataHolder.debug = true;
 
SWX.prepare(dataHolder);
 
dataHolder.loadMovie("http://localhost:8888/php/swx.php", "GET");
 
function onEnterFrame()
{
    status.text = dataHolder.result;
}

The prepare() static method of the SWX class simply serializes your arguments into JSON format for you. Notice that the args property in your dataHolder is no longer a string but an ActionScript array with two numbers inside it.

This is definitely far better than manually serializing your arguments by hand but it's still not ideal, is it? For one thing, that onEnterFrame function we're using is not a good practice. It would be really nice if we could have an event handler called when the data arrives instead of polling for it. The SWX ActionScript Library provides that functionality for you too.




Bad Behavior has blocked 3757 access attempts in the last 7 days.