MACROMEDIA FLEX 2-MIGRATING APPLICATIONS TO FLEX 2 Bedienungsanleitung Seite 14

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 184
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 13
14 Getting Started
Effects/behaviors
For each effect, such as Fade, Sequence, and Parallel, change the name property to id. Also,
remove the
<mx:Effect> tags; for example:
<mx:Sequence id="myWipes">
<mx:WipeLeft/>
<mx:WipeRight/>
<mx:WipeUp/>
<mx:WipeDown/>
</mx:Sequence>
For more information, see Chapter 8, “Behaviors,” on page 129.
getURL() method
Replace the getURL() method with the navigateToURL() method in the flash.net package.
This global method takes a URLRequest object; for example:
var url:URLRequest = new URLRequest("http://mysite.com");
navigateToURL(url,"_self");
For more information, see Chapter 34, “Communicating with the Wrapper,” in Flex 2
Developer’s Guide.
Step 2: Add access modifiers
You must add access modifiers to all your properties, variables, methods, and classes. Available
access modifiers are
public, internal, private, or protected.
When you first write or port an application, it is easiest to set every method and property to
public. You can then revisit the application when it is working and begin restricting access by
adding the
private identifier where necessary.
The following table shows some common situations where you add modifiers:
Flex 1.x Flex 2
function processVariables() {
// Returns a Boolean
}
public function processVariables():Boolean {
// Returns a Boolean
}
function getBalance() { ... } private function getBalance():Number { ... }
var s = "My name is Fred."; private var s:String = "My name is Fred.";
class MyButton extends Button { ... } public class MyButton extends Button { ... }
Seitenansicht 13
1 2 ... 9 10 11 12 13 14 15 16 17 18 19 ... 183 184

Kommentare zu diesen Handbüchern

Keine Kommentare