There's a couple of ways. If your class and function are static, like a utility class that doesn't persist any data, just call Layout.traceTest(); Note: Classes should be capitalized, in order to differentiate them from variables. Another way is to instantiate the class as a variable:
private function callClassFunction():void { var layout:Layout = new Layout(); layout.traceTest(); } -TH --- In flexcoders@yahoogroups.com, "sailorsea21" <sailorse...@...> wrote: > > Hi everyone, How can I call a function from a class? > > ////// MAIN FILE > import test.layout; > > private function callClassFunction():void > { > test.layout_QT.traceTest(); > } > > > > ////// CLASS FILE layout.as > package test > { > public class layout > { > public function traceTest():void > { > trace("This is a test."); > } > } > } > > Thanks. >