In Flash Action Scripting, packages playa pivotal role; these are implemented along with namespaces but are not synonymous with them. While declaring a package a special type of names pace is implicitly created that is only known at compile time. The following code uses the package directive to create a simple package
having one class.
package samplecode
{
public class SampleCoding
{
public var sampleGreeting:String:
public funcation sampleFunction()
{
trace (sampleGreeting + " from sampleFunction () ");
}
}
}
The class that is declared above is the SampleCoding class lying inside the samples package. Due to this the complier automatically assigns the class name during compile time into its qualified name.
![]()



Reply With Quote
Copyright Techfuels
Bookmarks