Web Technologies WNM-608. Class meets in 180NM and Online this Spring 2012 in San Francisco. Classroom:555 Mailbox: 5th Floor Mailroom 180NM
Thursday, April 30, 2009
Wednesday, April 29, 2009
Thursday, April 23, 2009
Wednesday, April 22, 2009
Gizmodo - Museum Exhibit Explores Rome Through iMacs and Augmented Reality - Allard Pierson Museum
Gizmodo - Museum Exhibit Explores Rome Through iMacs and Augmented Reality - Allard Pierson Museum:
In 'A Future for the Past,' a swiveling iMac superimposes buildings and text onto two large pictures/murals. Tricks like this one are not new to advertising, but rarely have we noticed the principles of augmented reality making their way into public spaces.
In 'A Future for the Past,' a swiveling iMac superimposes buildings and text onto two large pictures/murals. Tricks like this one are not new to advertising, but rarely have we noticed the principles of augmented reality making their way into public spaces.
University of Southern California and Nokia Announce Extensive Research Collaboration Framework Agreement
University of Southern California and Nokia Announce Extensive Research Collaboration Framework Agreement
AR is a key technology in enabling advanced mobile user applications. In this initial project, USC and Nokia will focus on new vision-based AR tracking and content recognition techniques, adapted for use on mobile platforms.
AR is a key technology in enabling advanced mobile user applications. In this initial project, USC and Nokia will focus on new vision-based AR tracking and content recognition techniques, adapted for use on mobile platforms.
Nokia Developing Augmented Reality For Cell Phones -- Cell Phone -- InformationWeek
Nokia Developing Augmented Reality For Cell Phones -- Cell Phone -- InformationWeek
The handset maker is teaming up with USC on projects designed to bring sounds, haptics, and even smell to its products.
The handset maker is teaming up with USC on projects designed to bring sounds, haptics, and even smell to its products.
Augmented Reality
Augmented Reality
Subobject Detection through Spatial Relationships on Mobile Phones
We present a novel image classification technique for detecting multiple objects (called subobjects) in a single image. In addition to image classifiers, we apply spatial relationships among the subobjects to verify and to predict locations of detected and undetected subobjects, respectively. By continuously refining the spatial relationships throughout the detection process, even locations of completely occluded exhibits can be determined. Finally, all detected subobjects are labeled and the user can select the object of interest for retrieving corresponding multimedia information. This approach is applied in the context of PhoneGuide, an adaptive museum guidance system for camera-equipped mobile phones.
We show that the recognition of subobjects using spatial relationships is up to 68% faster than related approaches without spatial relationships. Results of a field experiment in a local museum illustrate that unexperienced users reach an average recognition rate for subobjects of 85.6% under realistic conditions.
Subobject Detection through Spatial Relationships on Mobile Phones
We present a novel image classification technique for detecting multiple objects (called subobjects) in a single image. In addition to image classifiers, we apply spatial relationships among the subobjects to verify and to predict locations of detected and undetected subobjects, respectively. By continuously refining the spatial relationships throughout the detection process, even locations of completely occluded exhibits can be determined. Finally, all detected subobjects are labeled and the user can select the object of interest for retrieving corresponding multimedia information. This approach is applied in the context of PhoneGuide, an adaptive museum guidance system for camera-equipped mobile phones.
We show that the recognition of subobjects using spatial relationships is up to 68% faster than related approaches without spatial relationships. Results of a field experiment in a local museum illustrate that unexperienced users reach an average recognition rate for subobjects of 85.6% under realistic conditions.
HowStuffWorks "How Augmented Reality Will Work"
HowStuffWorks "How Augmented Reality Will Work"
Video games have been entertaining us for nearly 30 years, ever since Pong was introduced to arcades in the early 1970s. Computer graphics have become much more sophisticated since then, and soon, game graphics will seem all too real. In the next decade, researchers plan to pull graphics out of your television screen or computer display and integrate them into real-world environments. This new technology, called augmented reality, will further blur the line between what's real and what's computer-generated by enhancing what we see, hear, feel and smell.
Video games have been entertaining us for nearly 30 years, ever since Pong was introduced to arcades in the early 1970s. Computer graphics have become much more sophisticated since then, and soon, game graphics will seem all too real. In the next decade, researchers plan to pull graphics out of your television screen or computer display and integrate them into real-world environments. This new technology, called augmented reality, will further blur the line between what's real and what's computer-generated by enhancing what we see, hear, feel and smell.
Augmented reality - Wikipedia, the free encyclopedia
Augmented reality - Wikipedia, the free encyclopedia
Augmented reality (AR) is a field of computer research which deals with the combination of real-world and computer-generated data (virtual reality), where computer graphics objects are blended into real footage in real time.
At present, most AR research is concerned with the use of live video imagery which is digitally processed and 'augmented' by the addition of computer-generated graphics. Advanced research includes the use of motion-tracking data, fiducial markers recognition using machine vision, and the construction of controlled environments containing any number of sensors and actuators.
Augmented reality (AR) is a field of computer research which deals with the combination of real-world and computer-generated data (virtual reality), where computer graphics objects are blended into real footage in real time.
At present, most AR research is concerned with the use of live video imagery which is digitally processed and 'augmented' by the addition of computer-generated graphics. Advanced research includes the use of motion-tracking data, fiducial markers recognition using machine vision, and the construction of controlled environments containing any number of sensors and actuators.
Tuesday, April 21, 2009
Tips | Ajar Productions
Tips | Ajar Productions
stage.width will return the width of the content on the stage and ignore any empty pixels around the edges. So if you only have a 100 px wide rectangle on stage, your stage.width will be 100.
stage.stageWidth will give you the size of the stage, more like Stage.width in Actionscript 2. Use stage.stageWidth if you’re trying to position elements relative to the stage.
Same goes for stage.height and stage.stageHeight.
stage.width will return the width of the content on the stage and ignore any empty pixels around the edges. So if you only have a 100 px wide rectangle on stage, your stage.width will be 100.
stage.stageWidth will give you the size of the stage, more like Stage.width in Actionscript 2. Use stage.stageWidth if you’re trying to position elements relative to the stage.
Same goes for stage.height and stage.stageHeight.
Monday, April 20, 2009
Adobe Flash Player - Downloads
Adobe Flash Player - Downloads
Adobe Flash Player 10 — Debugger Versions (aka debug players or content debuggers)
2/24/09 Updated debugger versions of Flash Player 10 (aka debug players or content debuggers) are available. These new players are version 10.0.22.87.
Adobe Flash Player 10 — Debugger Versions (aka debug players or content debuggers)
2/24/09 Updated debugger versions of Flash Player 10 (aka debug players or content debuggers) are available. These new players are version 10.0.22.87.
senocular.com : News
senocular.com : News: "Here's an interesting factoid/precaution for you ActionScript developers out there: Did you know that Loader instances use the same LoaderInfo for all loaded content?
Why is this important? Most of the time, it's not. After all, you probably didn't already know this, cared to think about it, or even had any problems because of it. This is because, typically, when you load something in a Loader and then unload it or replace it with something else, you no longer need or interact with the original content you loaded. But what if that content is still used? Then, you might find yourself in for a surprise since Loader.contentLoaderInfo is the same LoaderInfo object each DisplayObject loaded into that Loader uses for it's own loaderInfo despite the originating SWF."
Why is this important? Most of the time, it's not. After all, you probably didn't already know this, cared to think about it, or even had any problems because of it. This is because, typically, when you load something in a Loader and then unload it or replace it with something else, you no longer need or interact with the original content you loaded. But what if that content is still used? Then, you might find yourself in for a surprise since Loader.contentLoaderInfo is the same LoaderInfo object each DisplayObject loaded into that Loader uses for it's own loaderInfo despite the originating SWF."
flash.net package - Flash CS4 Professional ActionScript 3.0 Language Reference
flash.net package - Flash CS4 Professional ActionScript 3.0 Language Reference
navigateToURL () function
public function navigateToURL(request:URLRequest, window:String = null):void
Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0 Flash Player 9
Opens or replaces a window in the application that contains the Flash Player container (usually a browser). In Adobe AIR, the function opens a URL in the default system web browser
Important Security Note
Developers often pass URL values to the navigateToURL() function that were obtained from external sources such as FlashVars. Attackers may try to manipulate these external sources to perform attacks such as cross-site scripting. Therefore, developers should validate all URLs before passing them to this function.
Good data validation for URLs can mean different things depending on the usage of the URL within the overall application. The most common data validation techniques include validating that the URL is of the appropriate scheme. For instance, unintentionally allowing javascript: URLs may result in cross-site scripting. Validating that the URL is a within your domain can ensure that the SWF file can't be used as an open-redirector by people who conduct phishing attacks. For additional security, you may also choose to validate the path of the URL and to validate that the URL conforms to the RFC guidelines
For example, the following code shows a simple example of performing data validation by denying any URL that does not begin with http:// or https:// and validating that the URL is within your domain name. This example may not be appropriate for all web applications and you should consider whether additional checks against the URL are necessary.
navigateToURL () function
public function navigateToURL(request:URLRequest, window:String = null):void
Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0 Flash Player 9
Opens or replaces a window in the application that contains the Flash Player container (usually a browser). In Adobe AIR, the function opens a URL in the default system web browser
Important Security Note
Developers often pass URL values to the navigateToURL() function that were obtained from external sources such as FlashVars. Attackers may try to manipulate these external sources to perform attacks such as cross-site scripting. Therefore, developers should validate all URLs before passing them to this function.
Good data validation for URLs can mean different things depending on the usage of the URL within the overall application. The most common data validation techniques include validating that the URL is of the appropriate scheme. For instance, unintentionally allowing javascript: URLs may result in cross-site scripting. Validating that the URL is a within your domain can ensure that the SWF file can't be used as an open-redirector by people who conduct phishing attacks. For additional security, you may also choose to validate the path of the URL and to validate that the URL conforms to the RFC guidelines
For example, the following code shows a simple example of performing data validation by denying any URL that does not begin with http:// or https:// and validating that the URL is within your domain name. This example may not be appropriate for all web applications and you should consider whether additional checks against the URL are necessary.
Thursday, April 16, 2009
SoundChannel - Flash CS4 Professional ActionScript 3.0 Language Reference
SoundChannel - Flash CS4 Professional ActionScript 3.0 Language Reference: "The SoundChannel class controls a sound in an application. Every sound is assigned to a sound channel, and the application can have multiple sound channels that are mixed together. The SoundChannel class contains a stop() method, properties for monitoring the amplitude (volume) of the channel, and a property for assigning a SoundTransform object to the channel."
KeyframeBase - Flash CS4 Professional ActionScript 3.0 Language Reference
KeyframeBase - Flash CS4 Professional ActionScript 3.0 Language Reference
AIR-only filters property
public var filters:Array
Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: AIR 1.0
An array that contains each filter object to be applied to the target object at a particular keyframe.
AIR-only filters property
public var filters:Array
Language Version: ActionScript 3.0
Product Version: Flash CS4
Runtime Versions: AIR 1.0
An array that contains each filter object to be applied to the target object at a particular keyframe.
E4X in ActionScript 3.0 - sephiroth.it
E4X in ActionScript 3.0 - sephiroth.it
Actionscript 3.0 finally introduced the powerful XML handling E4X ECMAScript for XML.
This new class introduces a new way to look at the XML strings using native actionscript objects.
You can read the full specifications of this powerful sub-language at http://www.ecma-international.org/../Ecma-357.htm
Actionscript 3.0 finally introduced the powerful XML handling E4X ECMAScript for XML.
This new class introduces a new way to look at the XML strings using native actionscript objects.
You can read the full specifications of this powerful sub-language at http://www.ecma-international.org/../Ecma-357.htm
TextField - Flash CS4 Professional ActionScript 3.0 Language Reference
TextField - Flash CS4 Professional ActionScript 3.0 Language Reference
The following example defines two TextField objects. The first TextField object has two associated event handlers. When you click the mouse inside this first text field, the mouseDown event is dispatched, and the associated mouseDownScroll handler is called. The mouseDownScroll() handler causes the field to scroll. Then, the scroll event is dispatched, and the associated scrollHandler() handler updates the second text field to display the current scroll position.
package
{
import flash.display.Sprite;
import flash.text.*;
import flash.events.Event;
import flash.events.TextEvent;
import flash.events.MouseEvent;
public class TextScrollExample extends Sprite
{
private var myTextBox1:TextField = new TextField();
private var myTextBox2:TextField = new TextField();
private var myText:String = "Hello world and welcome to the show. It's really nice to meet you. Take your coat off and stay a while. OK, show is over. Hope you had fun. You can go home now. Don't forget to tip your waiter. There are mints in the bowl by the door. Thank you. Please come again.";
public function TextScrollExample()
{
myTextBox1.text = myText;
myTextBox1.width = 200;
myTextBox1.height = 50;
myTextBox1.multiline = true;
myTextBox1.wordWrap = true;
myTextBox1.background = true;
myTextBox1.border = true;
myTextBox2.x=220;
myTextBox2.text="scrolled to line: " + myTextBox1.scrollV;
addChild(myTextBox1);
addChild(myTextBox2);
myTextBox1.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownScroll);
myTextBox1.addEventListener(Event.SCROLL, scrollHandler);
}
public function mouseDownScroll(event:MouseEvent):void
{
myTextBox1.scrollV++;
}
public function scrollHandler(event:Event):void
{
myTextBox2.text="scrolled to line: " + myTextBox1.scrollV;
}
}
}
The following example defines two TextField objects. The first TextField object has two associated event handlers. When you click the mouse inside this first text field, the mouseDown event is dispatched, and the associated mouseDownScroll handler is called. The mouseDownScroll() handler causes the field to scroll. Then, the scroll event is dispatched, and the associated scrollHandler() handler updates the second text field to display the current scroll position.
package
{
import flash.display.Sprite;
import flash.text.*;
import flash.events.Event;
import flash.events.TextEvent;
import flash.events.MouseEvent;
public class TextScrollExample extends Sprite
{
private var myTextBox1:TextField = new TextField();
private var myTextBox2:TextField = new TextField();
private var myText:String = "Hello world and welcome to the show. It's really nice to meet you. Take your coat off and stay a while. OK, show is over. Hope you had fun. You can go home now. Don't forget to tip your waiter. There are mints in the bowl by the door. Thank you. Please come again.";
public function TextScrollExample()
{
myTextBox1.text = myText;
myTextBox1.width = 200;
myTextBox1.height = 50;
myTextBox1.multiline = true;
myTextBox1.wordWrap = true;
myTextBox1.background = true;
myTextBox1.border = true;
myTextBox2.x=220;
myTextBox2.text="scrolled to line: " + myTextBox1.scrollV;
addChild(myTextBox1);
addChild(myTextBox2);
myTextBox1.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownScroll);
myTextBox1.addEventListener(Event.SCROLL, scrollHandler);
}
public function mouseDownScroll(event:MouseEvent):void
{
myTextBox1.scrollV++;
}
public function scrollHandler(event:Event):void
{
myTextBox2.text="scrolled to line: " + myTextBox1.scrollV;
}
}
}
DisplayObjectContainer - Flash CS4 Professional ActionScript 3.0 Language Reference
DisplayObjectContainer - Flash CS4 Professional ActionScript 3.0 Language Reference
addChild () method
public function addChild(child:DisplayObject):DisplayObject
Language Version: ActionScript 3.0
Runtime Versions: Flash Player 9, AIR 1.0
Adds a child DisplayObject instance to this DisplayObjectContainer instance. The child is added to the front (top) of all other children in this DisplayObjectContainer instance. (To add a child to a specific index position, use the addChildAt() method.)
If you add a child object that already has a different display object container as a parent, the object is removed from the child list of the other display object container.
Parameters
child:DisplayObject — The DisplayObject instance to add as a child of this DisplayObjectContainer instance.
Returns
DisplayObject — The DisplayObject instance that you pass in the child parameter.
Events
added:Event — Dispatched when a display object is added to the display list.
Throws
ArgumentError — Throws if the child is the same as the parent. Also throws if the caller is a child (or grandchild etc.) of the child being added.
addChild () method
public function addChild(child:DisplayObject):DisplayObject
Language Version: ActionScript 3.0
Runtime Versions: Flash Player 9, AIR 1.0
Adds a child DisplayObject instance to this DisplayObjectContainer instance. The child is added to the front (top) of all other children in this DisplayObjectContainer instance. (To add a child to a specific index position, use the addChildAt() method.)
If you add a child object that already has a different display object container as a parent, the object is removed from the child list of the other display object container.
Parameters
child:DisplayObject — The DisplayObject instance to add as a child of this DisplayObjectContainer instance.
Returns
DisplayObject — The DisplayObject instance that you pass in the child parameter.
Events
added:Event — Dispatched when a display object is added to the display list.
Throws
ArgumentError — Throws if the child is the same as the parent. Also throws if the caller is a child (or grandchild etc.) of the child being added.
The New York Times - Breaking News, World News & Multimedia
Package flash.text
Class public class TextField
Inheritance TextField Inheritance InteractiveObject Inheritance DisplayObject Inheritance EventDispatcher Inheritance Object
Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0 Flash Player 9
The TextField class is used to create display objects for text display and input. All dynamic and input text fields in a SWF file are instances of the TextField class. You can give a text field an instance name in the Property inspector and use the methods and properties of the TextField class to manipulate it with ActionScript. TextField instance names are displayed in the Movie Explorer and in the Insert Target Path dialog box in the Actions panel.
To create a text field dynamically, use the TextField() constructor.
The methods of the TextField class let you set, select, and manipulate text in a dynamic or input text field that you create during authoring or at runtime.
ActionScript provides several ways to format your text at runtime. The TextFormat class lets you set character and paragraph formatting for TextField objects. You can apply Cascading Style Sheets (CSS) styles to text fields by using the TextField.styleSheet property and the StyleSheet class. You can use CSS to style built-in HTML tags, define new formatting tags, or apply styles. You can assign HTML formatted text, which optionally uses CSS styles, directly to a text field. HTML text that you assign to a text field can contain embedded media (movie clips, SWF files, GIF files, PNG files, and JPEG files). The text wraps around the embedded media in the same way that a web browser wraps text around media embedded in an HTML document.
Flash Player supports a subset of HTML tags that you can use to format text. See the list of supported HTML tags in the description of the htmlText property.
Class public class TextField
Inheritance TextField Inheritance InteractiveObject Inheritance DisplayObject Inheritance EventDispatcher Inheritance Object
Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0 Flash Player 9
The TextField class is used to create display objects for text display and input. All dynamic and input text fields in a SWF file are instances of the TextField class. You can give a text field an instance name in the Property inspector and use the methods and properties of the TextField class to manipulate it with ActionScript. TextField instance names are displayed in the Movie Explorer and in the Insert Target Path dialog box in the Actions panel.
To create a text field dynamically, use the TextField() constructor.
The methods of the TextField class let you set, select, and manipulate text in a dynamic or input text field that you create during authoring or at runtime.
ActionScript provides several ways to format your text at runtime. The TextFormat class lets you set character and paragraph formatting for TextField objects. You can apply Cascading Style Sheets (CSS) styles to text fields by using the TextField.styleSheet property and the StyleSheet class. You can use CSS to style built-in HTML tags, define new formatting tags, or apply styles. You can assign HTML formatted text, which optionally uses CSS styles, directly to a text field. HTML text that you assign to a text field can contain embedded media (movie clips, SWF files, GIF files, PNG files, and JPEG files). The text wraps around the embedded media in the same way that a web browser wraps text around media embedded in an HTML document.
Flash Player supports a subset of HTML tags that you can use to format text. See the list of supported HTML tags in the description of the htmlText property.
Wednesday, April 15, 2009
Flash zoom in movie clip and re-scale (Website Design Tips)
here;s something
var javaMap:MovieClip;
//this turns the mc into a button
scaleUp.buttonMode = true;
//this allows flash to react to someone clicking on the mc
scaleUp.addEventListener(MouseEvent.CLICK, onClick)
function scaleMapUp(java:MovieClip):void
{
java.x -= .7;
java.y -= .7;
}
//this is what will happen when someone clicks on that mc box1
function onClick(event:MouseEvent):void
{
java.scaleX+=.02;
java.scaleY+=.02;
}
//box 2 is the pinkish one and it is the one that is going to scale the map smaller...
function scaleMapDown(java:MovieClip):void
{
java.x += 1;
java.y += 1;
}
//this scales the map
scaleMapDown(java);
//this turns the mc into a button
scaleDown.buttonMode = true;
scaleDown.addEventListener(MouseEvent.CLICK, onClickDown)
function onClickDown(event:MouseEvent):void
{
//event.target.scaleX+=-.02;
//event.target.scaleY+=-.02;
java.scaleX+=-.02;
java.scaleY+=-.02;
}
Flash zoom in movie clip and re-scale (Website Design Tips)
var javaMap:MovieClip;
//this turns the mc into a button
scaleUp.buttonMode = true;
//this allows flash to react to someone clicking on the mc
scaleUp.addEventListener(MouseEvent.CLICK, onClick)
function scaleMapUp(java:MovieClip):void
{
java.x -= .7;
java.y -= .7;
}
//this is what will happen when someone clicks on that mc box1
function onClick(event:MouseEvent):void
{
java.scaleX+=.02;
java.scaleY+=.02;
}
//box 2 is the pinkish one and it is the one that is going to scale the map smaller...
function scaleMapDown(java:MovieClip):void
{
java.x += 1;
java.y += 1;
}
//this scales the map
scaleMapDown(java);
//this turns the mc into a button
scaleDown.buttonMode = true;
scaleDown.addEventListener(MouseEvent.CLICK, onClickDown)
function onClickDown(event:MouseEvent):void
{
//event.target.scaleX+=-.02;
//event.target.scaleY+=-.02;
java.scaleX+=-.02;
java.scaleY+=-.02;
}
Flash zoom in movie clip and re-scale (Website Design Tips)
Scene7 - Solutions - Demos
Scene7 - Solutions - Demos this is for zooming in and out... what companies buy for quick solutions
Sharing data with Adobe Flash Collaboration Service beta – Part 1: Custom messaging | Adobe Developer Connection
Sharing data with Adobe Flash Collaboration Service beta – Part 1: Custom messaging | Adobe Developer Connection: "Adobe recently introduced the Adobe Flash Collaboration Service (formerly, code name 'Cocomo') beta, which is a hosted solution for real-time data sharing, collaboration, and custom messaging for Flex. Developers can create Flex applications that allow multiple clients to be aware of each other and to push data to each other at near-instantaneous speeds. The Adobe Flash Collaboration Service beta library allows you to wire all this up with only a few lines of code."
Flex cookbook beta - Creating a dynamically resizing TextArea without scrollbars
Flex cookbook beta - Creating a dynamically resizing TextArea without scrollbars: "------------------------------------- DynamicTextArea.as -------------------------------------"
TimerEvent - Flash CS4 Professional ActionScript 3.0 Language Reference
TimerEvent - Flash CS4 Professional ActionScript 3.0 Language Reference: "TIMER Constant
public static const TIMER:String = 'timer'
Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0 Flash Player 9
Defines the value of the type property of a timer event object.
This event has the following properties:
Property Value
bubbles false
cancelable false; there is no default behavior to cancel.
currentTarget The object that is actively processing the Event object with an event listener.
target The Timer object that has reached its interval."
public static const TIMER:String = 'timer'
Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0 Flash Player 9
Defines the value of the type property of a timer event object.
This event has the following properties:
Property Value
bubbles false
cancelable false; there is no default behavior to cancel.
currentTarget The object that is actively processing the Event object with an event listener.
target The Timer object that has reached its interval."
Tuesday, April 14, 2009
ExternalInterface - ActionScript 3.0 Language and Components Reference
ExternalInterface - ActionScript 3.0 Language and Components Reference: "package { import flash.text.TextField; import flash.display.MovieClip; import flash.external.ExternalInterface; public class extint_test extends MovieClip { public function extint_test() { var isAvailable:Boolean = ExternalInterface.available; var availTxt:TextField = new TextField(); availTxt.text = isAvailable.toString(); addChild(availTxt); } } }"
Friday, April 10, 2009
ExternalInterface - Flash CS4 Professional ActionScript 3.0 Language Reference
ExternalInterface - Flash CS4 Professional ActionScript 3.0 Language Reference
Language Version: ActionScript 3.0
Runtime Versions: Flash Player 9, AIR 1.0
The ExternalInterface class is the External API, an application programming interface that enables straightforward communication between ActionScript and the Flash Player container– for example, an HTML page with JavaScript. Adobe recommends using ExternalInterface for all JavaScript-ActionScript communication.
You can call an ActionScript function in Flash Player, using JavaScript in the HTML page. The ActionScript function can return a value, and JavaScript receives it immediately as the return value of the call.
This functionality replaces the fscommand() method.
From ActionScript, you can do the following on the HTML page:
* Call any JavaScript function.
* Pass any number of arguments, with any names.
* Pass various data types (Boolean, Number, String, and so on).
* Receive a return value from the JavaScript function.
From JavaScript on the HTML page, you can:
* Call an ActionScript function.
* Pass arguments using standard function call notation.
* Return a value to the JavaScript function.
Flash Player does not currently support SWF files embedded within HTML forms.
Note: In Adobe AIR, the ExternalInterface class can be used to communicate between JavaScript in an HTML page loaded in the HTMLLoader control and ActionScript in SWF content embedded in that HTML page.
Language Version: ActionScript 3.0
Runtime Versions: Flash Player 9, AIR 1.0
The ExternalInterface class is the External API, an application programming interface that enables straightforward communication between ActionScript and the Flash Player container– for example, an HTML page with JavaScript. Adobe recommends using ExternalInterface for all JavaScript-ActionScript communication.
You can call an ActionScript function in Flash Player, using JavaScript in the HTML page. The ActionScript function can return a value, and JavaScript receives it immediately as the return value of the call.
This functionality replaces the fscommand() method.
From ActionScript, you can do the following on the HTML page:
* Call any JavaScript function.
* Pass any number of arguments, with any names.
* Pass various data types (Boolean, Number, String, and so on).
* Receive a return value from the JavaScript function.
From JavaScript on the HTML page, you can:
* Call an ActionScript function.
* Pass arguments using standard function call notation.
* Return a value to the JavaScript function.
Flash Player does not currently support SWF files embedded within HTML forms.
Note: In Adobe AIR, the ExternalInterface class can be used to communicate between JavaScript in an HTML page loaded in the HTMLLoader control and ActionScript in SWF content embedded in that HTML page.
Thursday, April 9, 2009
Wednesday, April 8, 2009
loading a text document to read as html in flash
function loadMe(){
//the loadVars object called my data has in it the variables created with text
//load the variables into the right text boxes
_root.title.html = true;
_root.title.text = myData.title;
_root.title.htmlText = myData.title;
//tell the textBox to use html formating
_root.textBox.html = true;
//bring the text in as html
_root.textBox.htmlText = myData.textBox;
}
function loadPageText(){
//create a new loadVars object to hold the new data
myData = new LoadVars();
//load the data into the new loadVars object
myData.load("text/events.txt");
myData.onLoad = function(success){
//check to see if the data has in fact loaded yet
if (success){
//pass the data in the form of its variables to text boxes. See below.
loadMe();
}else{
_root.textBox.text = "waiting...";
}
}
}
//the loadVars object called my data has in it the variables created with text
//load the variables into the right text boxes
_root.title.html = true;
_root.title.text = myData.title;
_root.title.htmlText = myData.title;
//tell the textBox to use html formating
_root.textBox.html = true;
//bring the text in as html
_root.textBox.htmlText = myData.textBox;
}
function loadPageText(){
//create a new loadVars object to hold the new data
myData = new LoadVars();
//load the data into the new loadVars object
myData.load("text/events.txt");
myData.onLoad = function(success){
//check to see if the data has in fact loaded yet
if (success){
//pass the data in the form of its variables to text boxes. See below.
loadMe();
}else{
_root.textBox.text = "waiting...";
}
}
}
Thursday, April 2, 2009
Wednesday, April 1, 2009
Subscribe to:
Posts (Atom)