More on Nonpersistent Client-Side Remote Shared Objects - Minimalist Project for Shared Function (Page 2 of 4 )
This next little minimalist project is very cool. It allows you to open a web page on someone else’s browser. You can open up a web page from any domain, not just your local one. Here are the classes and objects you’ll use:
In step 1, a function is defined that includes a shared object data attribute in the definition. In step 2, an unnamed function (webPageobject) assigns the shared object a new value when the user presses a button and fills in an InputText component. In step 3, the change in the shared object triggers theSharedObject.onSyncfunction that contains thegetURL(url)function. Thus, all connections open up the same web page. Use Figure 4-5 as a guide and use the following steps to create the full application:
Figure 4-4. Path of shared object events
Figure 4-5. Objects and instant names
Open up a new Flash document and set up the following layers, from top to bottom: Actions, Text Input Component, Button, and Label.
In the Text Input Component layer, add a TextInput component and provide it with the instance nameurl_ti.
Add a button to the Button layer and give it the instance nameurl_button.
Add the label Enter URL Name (without http://) using static text on the Label layer. Add a logo in the upper left corner.
Click the first frame of the Actions layer and add the following script: