Reputation: 1179
I am trying to place API variables on ONE class file or mxml file and call these variables in other random class or mxml files... any suggestions?
Upvotes: 0
Views: 411
Reputation: 5342
I just create a file in any package and called it api.as. Inside there, there's just static member variables.
public static var foo:String = "Bar";
public static var bar:Number = "100";
...
Then you just include import <package_path>.api.as
in any files that want to use it.
EDIT: Already accepted, but answering the question:
package com.foo {
public class Api {
public static const FOOBAR:String = "foobar";
}
}
Upvotes: 2