Air application trace

Hi,
When i run my air application i am not able to get the trace output. I tryed "whistler","Vizzy".Still no use.
And the Air application didnt update the "Application Data\Macromedia\Flash Player\Logs\flashlog.txt"
How to get the Air application trace outputs.

How are you starting your application up?  Are you using ADL?
Chris

Similar Messages

  • Trace on air application runtime

    Hi,
    I want to see trace statement when i run my air .exe files. How to do that? Few of them ask to use the ADL,But I am not much aware of that.On my client place some time my air application get crash. Can i able to log the trace files ?
    Thanks,
    Siva

    Hi Siva,
    You're on the right track.  To get trace output you'll want to use adl.exe to launch your application.  Please see this doc for details:
    http://help.adobe.com/en_US/air/build/WSfffb011ac560372f-6fa6d7e0128cca93d31-8000.html
    Thanks,
    Chris

  • Communication problem between air application from swf at browser

    Hi,
    I am trying to communicate adobe air native application from brwser using swf, I check for native application installed or not. If installed then launch and if not then install and launch.
    I am facing problem when browser crashes and communication get lost with adobe air native application. And when user restart web browser and try to make local connection for communication with native application, some times it get failed. so, how to handle this state please help.
    Thanks
    Nitesh Kumar

    Hi sinious,
    How could I clean up connection when browser is aborted or lost?
    below you can find the code snippet to check for air application and connection
    airSWFLoader = new Loader();
                                  loaderContext = new LoaderContext();
                                  loaderContext.applicationDomain = ApplicationDomain.currentDomain;
                                  airSWFLoader.contentLoaderInfo.addEventListener(Event.INIT, onInit);
                                  airSWFLoader.load(new URLRequest("http://airdownload.adobe.com/air/browserapi/air.swf"),loaderContext);
    function onInit(e:Event):void 
                                  airSWF = e.target.content; 
                                  switch(airSWF.getStatus().toString())
                                            case "available" : AirLoaderStatus = 1;
                                            break;
                                            case "unavailable" : AirLoaderStatus = 2;
                                            break;
                                            case "installed" : AirLoaderStatus = 3;
                                            break;
    private function getAppStatus():void
                                  clearInterval(intervalIdentifier);
                                  if(AirLoaderStatus == 0){intervalIdentifier = setInterval(getAppStatus,1000);return;}
                                  m_launchInstallBtn.visible = true;
                                  var statusInfo:String = airSWF.getStatus();
                                  airSWF.getApplicationVersion(m_installerFileName, m_pubID, versionDetectCallback);
    function versionDetectCallback(version:String):void
                                  if (version == null)
                                            trace("Not Installed");
                                            // Take appropriate actions. For instance, present the user with
                                            // an option to install the application.
                                  else
                                            m_isPluginsInstalled = true;
                                            // Take appropriate actions. For instance, enable the
                                            // user interface to launch the application.
    private function onlickMouse(event:MouseEvent):void
                                  m_text.text += "\nm_isPluginsInstalled:"+m_isPluginsInstalled+":::AirLoaderStatus:"+AirLoaderStatus;
                                  trace("\nm_isPluginsInstalled:"+m_isPluginsInstalled+":::AirLoaderStatus:" +AirLoaderStatus);
                                  switch(event.currentTarget)
                                            case m_launchInstallBtn:
                                                         if(AirLoaderStatus == 1)
           installAirsetup();
                                                      else
                                                                if(!m_isPluginsInstalled)
                                                                          airSWF.installApplication(m_url, m_runtimeVersion, m_argsToPass);
                                                                          airSWF.launchApplication(m_installerFileName, m_pubID, m_argsToPass);
                                                                else
                                                                          airSWF.launchApplication(m_installerFileName, m_pubID, m_argsToPass);
                                            break;
    in the above code snippet I pass localConnection for send and recieve as an argument in m_argsToPass.
    the connection names strarts with "_".
    In the air application I I split the event arguments like given below
    argsArray = event.arguments.toString().split(",");
    and then try to establish connection.
    Please suggest, how could I clean the connection on lost/ abort of browser, since then swf object embeded in browser also get lost.

  • Display image in standalone AIR application

    I have loaded images and like to display image in standalone AIR application. But I cannot get it work. The code as follows:
    private function ImageLoader(url:String):void
    var request:URLRequest = new URLRequest(url);
    var loader:Loader = new Loader();
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaderComplete);
    loader.load(request);    
    private function loaderComplete(event:Event):void
    var scaleFactor:Number = 1;
    var uic:UIComponent = new UIComponent();
    try
    var bmp:Bitmap = event.target.content as Bitmap;
    var bmd:BitmapData = bmp.bitmapData; //Bitmap(event.target.content).bitmapData;
    var scaledBMD:BitmapData = new BitmapData(400, 400);
    var matrix:Matrix = new Matrix();
    matrix.scale(scaleFactor, scaleFactor);
    scaledBMD.draw(bmd, matrix, null, null, null, true);
    uic.x = 40;
    uic.y = 40;
    uic.addChild(new Bitmap(scaledBMD));
    catch (errObject:Error)
    trace(errObject.message);

    Found answer by adding mx:Canvas and add
    iconCanvas.addChild(uic);
    after
    uic.addChild(new Bitmap(scaledBMD));
    <mx:Canvas id="iconCanvas" width="10" height="10" horizontalScrollPolicy="off" verticalScrollPolicy="off" x="0" y="0" clipContent="false"/>
    Is anyone create "Canvas" by using new Canvas and get it works? example:
    var canv:Canvas = new Canvas(...);

  • Blue screen of death while installing any Adobe Air application

    Whenever I try to install an Air application I get a  Blue Screen and then my system restarts.
    I cannot even take a screenshot  of it.
    This happens with every air application I try to install.
    I also searched for the same on Adobe forums and found the same problem being faced by someone else.
    His problem was resolved by uninstalling a software named "Folder Lock".
    I searched my hard disk for this software and found one, so I deleted  that software (shift+delete) and removed all it's traces from registry  too but that still doesn't solved the problem.
    I also tried disabling the antivirus software and then install the air application but this also didn't helped.
    I was able to install air applications earlier, but now I can't.
    Anybody having same sort of problem. One colleague of mine is also having the same problem.
    Please help me out.
    My system's config is as follows:
    Windows XP Home sp3
    Flash Builder 4, with SDK 4.1, 3.5 installed in it.
    Adobe Air v 2.5
    1.5 GB RAM
    1.66 MHz processor
    Thanks

    Hello chris,
    Thank you for taking out your time to solve my problem.
    I did all the steps mentioned in that link i.e. installed folder lock and uninstalled it from it's options only.
    But it didn't solve my problem.
    Here is the screenshot of the Blue Screen Of Death that I was presented while the application was being installed.
    The BSOD appeared while the application install progress is shown to the end user.
    I hope this will help you get more insight of the issue.
    Thanks

  • How to play and stop flv files through NetStream in AIR Application

    Hi,
    In a folder I have 'n' number of flv file, which are DRM protected. when the user try to play those files for the first time through my AIR application, it will prompt for username and password and gets the license/voucher from the server and store it in AIR Runtime. so that from the next time onwords it won't prompt for username and password as because it already has license/voucher.
         My problem is assume there are 500 files, such that for each file the user has to enter his credentials[username and password]. which is a stupid thing. I want to avoid this process by implementing this process internally/programetically. By playing/accessing each file through netstream from the folder and setDRMAuthenticationCredentials for that file and stop the stream. Here I am able to play each file but I am failed to stop it. I mean to say I will get the license for all the flv files internally[while loading my AIR application], such that user should not be interrupted for his credentials for each file.He should play as if he is accessing/playing a non-DRM protected file. I will be very thank full if any one help me out in this.
    public function init():void {
          connectStream();
          getLicenseForAllFiles();
          videoStream.addEventListener(DRMAuthenticateEvent.DRM_AUTHENTICATE, drmAuthenticateEventHandler);
          ppt_videoStream.addEventListener(DRMAuthenticateEvent.DRM_AUTHENTICATE, ppt_drmAuthenticateEventHandler);
            private function getFilesRecursive(rootFolderPath:String):void {
                //the current folder object
                var currentFolder:File = new File(rootFolderPath);
                //the current folder's file listing
                var files:Array = currentFolder.getDirectoryListing();
                //iterate and put files in the result and process the sub folders recursively
                for (var f = 0; f < files.length; f++) {
                    if (files[f].isDirectory) {
                        if (files[f].name !="." && files[f].name !="..") {
                            //it's a directory
                            getFilesRecursive(files[f].nativePath);
                    } else {
                        //it's a file
                        fileList.push(files[f].nativePath);
                        //Alert.show(""+files[0].nativePath);
                        var fileName:String = files[f].name;
                        if(fileName.indexOf("PPT_")!=-1){
                            ppt_videoStream.play(files[f].nativePath);
                            ppt_videoStream.pause();
                        videoStream.play(files[f].nativePath);
                        videoStream.pause();
                private function connectStream():void {
                    videoConnection = new NetConnection();
                    videoConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                    videoConnection.connect(null);
                    ppt_videoConnection = new NetConnection();
                    ppt_videoConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                    ppt_videoConnection.connect(null);
                    videoStream = new NetStream(videoConnection);
                    videoStream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                    video.attachNetStream(videoStream);
                    ppt_videoStream = new NetStream(ppt_videoConnection);
                    ppt_videoStream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                    ppt_video.attachNetStream(ppt_videoStream);
             private function netStatusHandler(event:NetStatusEvent):void {
                switch (event.info.code) {
                    case "NetConnection.Connect.Success":
                        //connectStream();
                        break;
                    case "NetStream.Play.StreamNotFound":
                        trace("Unable to locate video: " + videoURL);
                        break;
                private function drmAuthenticateEventHandler(event:DRMAuthenticateEvent):void {
                    videoStream.setDRMAuthenticationCredentials("adobe", "adobe", "drm");
                private function ppt_drmAuthenticateEventHandler(event:DRMAuthenticateEvent):void {
                    ppt_videoStream.setDRMAuthenticationCredentials("adobe", "adobe", "drm");
    Thanks
    Sudheer Puppala

    Hi,
    Please go through following links..this will help you:
    http://lucamezzalira.com/2009/02/28/create-pdf-in-runtime-with-actionscript-3-alivepdf-zin c-or-air-flex-or-flash/
    http://forums.adobe.com/thread/753959
    http://blog.unthinkmedia.com/2008/09/05/exporting-pdfs-in-flex-using-alivepdf/
    Thanks and Regards,
    Vibhuti Gosavi | [email protected] | www.infocepts.com

  • Trying to load MP3 from desktop to AIR application

    I'm trying to load an MP3 file into an Air application.
    Here's some code. The first 2 lines are in my constructor
    fileToOpen.browseForOpen("Open", [new FileFilter("MP3",
    "*.mp3")]);
    fileToOpen.addEventListener(Event.SELECT, fileSelected);
    private function fileSelected(event:Event):void
    var stream:FileStream = new FileStream();
    trace(fileToOpen.nativePath);
    // sound = new Sound(new URLRequest(fileToOpen.nativePath));
    // trace(sound);
    stream.open(event.target, FileMode.READ);
    trace(stream.bytesAvailable);
    sound = new Sound(stream.readBytes(stream.bytesAvailable));
    channel = sound.play(00000);
    addEventListener(Event.ENTER_FRAME, onEnterFrame);
    Using URLRequest gives me the error Error #2044: Unhandled
    IOErrorEvent:. text=Error #2032: Stream Error. I can't seem to load
    a file when I give it the full path. Then with the file stream, I
    don't even know what I'm doing. I don't know which method I'm
    supposed to use to load the file into a sound object. Please
    help...

    I figured it out. I tried url instead of nativePath for the
    file object and it worked.

  • Adobe AIR application crash on start in iOS devices

    I have Adobe AIR application that uses Starling and DragonBones.
    We use IntelliJ IDE.
    We can run the application on the device without problem when running from the IDE.
    We build an ad-hoc distribution and put it on a device using TestFlight.
    When we run the application it show the splash-screen image and after that either go into white blank screen or crashes.
    In the XCode Organizer crash report I can't find helpful information.
    How can I debug this problem?

    Any chance of Testing with Flash Professional ? If so than connect your device and in Flash Professional CC go to Debug->Debug Movie-> On Device Via Usb -> Select your device.
    It will start a debug session as soon as you start your app/game and than you can debug whats going wrong on the device, setup your trace statements or breakpoints and see in output panel what actually the problem is.
    I hope it will help or some community guru may assist you or particularly you can post your problem in starling forum too, may be someone will help you there ...
    PS: In debug session mode performance will be low so don't worry about that. This mode is just for debugging and testing purposes.
    Thanks,
    Muhammad Faisal Zaheer,
    Sr. Software Engineer, Team Lead, Cubix Labs

  • Triggering an event when the new  AIR application installation has done for first time in machine

    I am installing AIR application from web page by using a badge.Is it possible to call a function once the installation of AIR app was finished[once we click finish button in the installer] to update the AIR application version dynamically inside our code.If so please share. Any suggestion would be appreciated.

    Hi Rizwana,
    So as you said that you had created a event linkage between change document object and Business object you can now switch on the event trace SWELS and go to the particular transaction by which the event of this Business  Object gets triggered ( the event you mentioned in SWEC). Switch of the event trace (SWELS) and check the Business object that had triggered in SWEL transaction.
    Hope this would help you.
    Any clarification.. then please revert back.
    Good luck
    Narin

  • AIR application not installed

    Hi all,
    My AIR application not installed.
    AIR application installer shows window with 'Getting ready to install..." and window closed and nothing happens. What I'm doing wrong and where I can see an 'installation log' to obtain the root reason of AIR installation problems?
    My env: Fedora 12 x64, AIR and AIR SDK just downloaded and installed from site. All AIR SDK applications (adl and adt) works well.
    Sergey

    Thank you for your reply!
    airappinstaller throws SIGSEGV signal.
    I trace it in gdb and see that libxml2::xmlHasProp throws this signal because it receive an invalid node pointer from libadobecertstore.so.
    So I can't find or obtain debug symbols for adobeair-1.5.3-9130.i386 and I don't know what I should do to fix a problem...

  • Air Application URL Path Issue

    I am trying to invoke a  content of the file which is in shared folder from Air application.
    Version : Flash builder 4.5,Flex3.6 sdk and Air 2.7.
    for this am using the below code..
    var request:URLRequest = new URLRequest();
    //request.url = ('file:///c:/params.txt'); - This is working fine
    request.url = ('file:///172.20.188.25/Share/chk/Property/params.txt');  // its not working
    trace("Unable to load URL: " + request);
    var variables:URLLoader = new URLLoader();
    variables.dataFormat = URLLoaderDataFormat.VARIABLES;
    variables.addEventListener(Event.COMPLETE, completeHandler);
    try
    variables.load(request);
    The same part of code ,I tried in Flex application is working .but in Air application its not working.
    Its urgent requirement,If any one know the way to resolve this path issues.
    Kindly let us know.
    Thanks in Advance !!

    I tried in the following URL but no use ..
    its throwing ioError and textError and stream error.
    1.file:///172.20.188.25/Share/chk/Property/params.txt
    2.http://172.20.188.25/Share/chk/Property/params.txt
    3. //172.20.188.25/Share/chk/Property/params.txt
    Is there any other solution for this issue ?

  • CLOSING AN AIR APPLICATION

    I am writing an air application.  If a user clicks the close button up in the titlebar, I want to be able to create a pop-up that asks if they would like to save their project before exiting.  The problem is that the program just exits without displaying the pop-up.  I am listening for a "close" event and then calling a handler to issue the pop-up.  Using trace statements, I can confirm that it is making it to my handler but the application closes even though I don't issue a close() or exit() statement.  Here is the XML and the actionscript that I have(states and import statements are not included for brevity):
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                                                         xmlns:s="library://ns.adobe.com/flex/spark"
                                                         xmlns:mx="library://ns.adobe.com/flex/mx" width="1050" height="765"
                                                         applicationComplete="init()"  close="closeApplication(event)">
         <fx:Script>
              <![CDATA[              
                        protected function closeApplication(event:Event):void
                             if (this.currentState == "main" || this.currentState == "first" || this.currentState == "second"){
                                       trace("true");
                                       var savePopUp:SaveComponent = PopUpManager.createPopUp(videoGroup, SaveComponent, true) as SaveComponent;
                                       savePopUp.title = "Save";
                                       PopUpManager.centerPopUp(savePopUp);
                             else {
                                            trace("false");
                                        this.exit();
              ]]>
         </fx:Script>
    </s:WindowedApplication>
    If the application is in certain states, I want the user to recieve a popup used for saving a project before the program exits, but the program is not waiting for me to give the exit() or close() command.  Is there a way to override this, to inercept it, or something?  Or to listen for a different event?

    I figured this one out on my own.  At the top of the closeApplication handler, you just have to add this line:
    event.preventDefault();
    This causes Flex to not close the program which is the default for clicking the "close" button.  Also, you should use NativeApplication.nativeApplication.exit() to close all the windows in the application instead of this.exit() as I did.

  • AIR application opening a file.

    I am writing an AIR application.
        Below is the code I am using to load a file that is located in the same directory as my flash.fla. I hard coded the file path for testing purposes only. When I run the application in the debugger I get the error traced.
    package {
              import flash.display.Sprite;
              import flash.filesystem.File;
              //import ui.FileToData;
              import flash.events.Event;
              import flash.events.IOErrorEvent;
              public class MCFlash extends Sprite {
                                  var sourceFile:File;
                        public function MCFlash() {
                                  sourceFile = new File("C:\Randy\flash\MCFlash\church.text");
                                  //var fileToData:FileToData = new FileToData(sourceFile);
                                  sourceFile.addEventListener(Event.COMPLETE, onFileLoaded);
                                  sourceFile.addEventListener(IOErrorEvent.IO_ERROR, onFileLoadError);
                                  sourceFile.load();
                        private function onFileLoaded(e:Event):void {
                                  sourceFile.removeEventListener(Event.COMPLETE, onFileLoaded);
                                  sourceFile.removeEventListener(IOErrorEvent.IO_ERROR, onFileLoadError);
                                  trace("file loaded");
                        private function onFileLoadError(e:IOErrorEvent):void {
                                  sourceFile.removeEventListener(Event.COMPLETE, onFileLoaded);
                                  sourceFile.removeEventListener(IOErrorEvent.IO_ERROR, onFileLoadError);
                                  trace(e);
    the error I get is: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2038: File I/O Error." errorID=2038]

    I probably mislead by putting text as the extension of the file. The file is actuelly a NBT compressed file. What I need to know is why I get an error opening the file when I hard code it. If I use a button to browse for the file I have no problem loaing it, and i do not get the error message.

  • Air application in XP

    I have an air application that installs and updates fine on Mac OS and Vista but always receive a "Air File is damaged" message when i try to install in windows XP. Ive tried stuffed and unstuffed files as well as copying the installer into the C:/Program Files folder and still the same error. Not sure what is happening...

    Nevermind. I got it by doing this:
        var str:String = new String(flash.filesystem.File.applicationStorageDirectory.nativePath);
        str = str.replace(flash.filesystem.File.userDirectory.nativePath+"\\","");
        var num:Number = str.indexOf("\\");
        str = str.substring(0,num);
        trace(str);

  • Desktop AIR Application installs fine on Mac... crashes on PC

    Hey guys,
    I ran into an issue that has be pulling my hair out. I have a very simple AIR application that was built with Flash CS6 on a Mac. The published app installs and runs perfectly on my Mac. Installation goes just fine on a PC, but the app will not launch! The window starts to come up and immediately crashes. I just finished making a desktop app in the last version of AIR and it ran perfect on PC.
    Has anyone else experienced this issue? So much fun using a Mac when most clients use PC lol!

    It's actually quite a tiny app. Tiny enough that I'm just coding in Flash CS6 in the first frame noob style LOL. I published another AIR app like this recently and it worked just fine on PC.
    Here is literally all of the code that runs the app. I am using the File class to access the desktop directory for some files, but my understanding is that it should access the desktop the same on PC and Mac.
    Thanks for the time and help... I could have a friend publish on a PC, but it would be much more convenient if I could get it to work correctly .
    import flash.display.MovieClip;
    import flash.display.SimpleButton;
    import flash.events.MouseEvent;
    import flash.filesystem.File;
    import flash.display.Loader;
    import flash.ui.MouseCursor;
    // START VARIABLE DECLARATION
    var XMLDirectory:File = File.desktopDirectory;
    XMLDirectory = XMLDirectory.resolvePath("missing_person/results.xml");
    var myXML:XML;
    var imageDirectory:File = File.desktopDirectory;
    imageDirectory = imageDirectory.resolvePath("missing_person/images/");
    var screen_saver:MovieClip;
    var part1_mc:MovieClip;
    var part2_mc:MovieClip;
    var rightBtn:SimpleButton = part2_mc.right_btn;
    var leftBtn:SimpleButton = part2_mc.left_btn;
    var heightOpt:MovieClip = part1_mc.height_options_mc;
    var heightBtn:SimpleButton = part1_mc.height_btn;
    var genderOpt:MovieClip = part1_mc.gender_options_mc;
    var genderBtn:SimpleButton = part1_mc.gender_btn;
    var ageOpt:MovieClip = part1_mc.age_options_mc;
    var ageBtn:SimpleButton = part1_mc.age_btn;
    var searchBtn:SimpleButton = part1_mc.search_btn;
    var resetBtn:SimpleButton = header_mc.restart_btn;
    var searchingDB:MovieClip = part1_mc.searching_mc;
    var startArray:Array = [[],[]];
    var ageStr:String = "";
    var heightStr:String = "";
    var genderStr:String = "";
    // KEEPS OVER STATES FOR BUTTONS
    var heightState = heightBtn.upState;
    var genderState = genderBtn.upState;
    var ageState = ageBtn.upState;
    var searchState = searchBtn.upState;
    // LOAD AND PARSE XML
    var myLoader:URLLoader = new URLLoader();
    myLoader.load(new URLRequest(XMLDirectory.url));
    myLoader.addEventListener(Event.COMPLETE, processXML);
    function processXML(e:Event):void
        myXML = new XML(e.target.data);
        for (var i:int = 0; i < myXML.result.length(); i++)
            startArray[i] = [(imageDirectory.url + "/" + myXML.result[i].image), myXML.result[i].name, myXML.result[i].age, myXML.result[i].gender, myXML.result[i].height, myXML.result[i].description, myXML.result[i].features];
            trace(startArray[i][0]);
    //CODE FOR BUTTON RESET
    resetBtn.addEventListener(MouseEvent.MOUSE_DOWN, resetAll);
    function resetAll(event:MouseEvent):void
        enableButtons();
        heightOpt.visible = false;
        genderOpt.visible = false;
        ageOpt.visible = false;
        searchingDB.visible = false;
        part1_mc.height_txt.text = "";
        part1_mc.gender_txt.text = "";
        part1_mc.age_txt.text = "";
        part2_mc.visible = false;
        part2_mc.removeChild(resultContainer);
    //BEGIN INITIALIZATION ;
    function init():void
            part1_mc.height_txt.text = "";
        part1_mc.gender_txt.text = "";
        part1_mc.age_txt.text = "";
        part1_mc.visible = false;
        part2_mc.visible = false;
        screen_saver.visible = true;
        heightOpt.visible = false;
        genderOpt.visible = false;
        ageOpt.visible = false;
        searchingDB.visible = false;
    init();
    heightBtn.addEventListener(MouseEvent.MOUSE_DOWN, showHeights);
    genderBtn.addEventListener(MouseEvent.MOUSE_DOWN, showGenders);
    ageBtn.addEventListener(MouseEvent.MOUSE_DOWN, showAges);
    function showHeights(event:MouseEvent):void
        heightOpt.visible = true;
        disableButtons();
        //ADD EVENT LISTENERS FOR HEIGHT OPTIONS
        heightOpt.opt_1.addEventListener(MouseEvent.MOUSE_DOWN, setHeight1);
        heightOpt.opt_2.addEventListener(MouseEvent.MOUSE_DOWN, setHeight2);
        heightOpt.opt_3.addEventListener(MouseEvent.MOUSE_DOWN, setHeight3);
        heightOpt.opt_4.addEventListener(MouseEvent.MOUSE_DOWN, setHeight4);
        heightOpt.opt_5.addEventListener(MouseEvent.MOUSE_DOWN, setHeight5);
        heightOpt.opt_6.addEventListener(MouseEvent.MOUSE_DOWN, setHeight6);
    function showGenders(event:MouseEvent):void
        genderOpt.visible = true;
        disableButtons();
        //ADD EVENT LISTENERS FOR HEIGHT OPTIONS
        genderOpt.opt_1.addEventListener(MouseEvent.MOUSE_DOWN, setGender1);
        genderOpt.opt_2.addEventListener(MouseEvent.MOUSE_DOWN, setGender2);
        genderOpt.opt_3.addEventListener(MouseEvent.MOUSE_DOWN, setGender3);
    function showAges(event:MouseEvent):void
        ageOpt.visible = true;
        disableButtons();
        //ADD EVENT LISTENERS FOR HEIGHT OPTIONS
        ageOpt.opt_1.addEventListener(MouseEvent.MOUSE_DOWN, setAge1);
        ageOpt.opt_2.addEventListener(MouseEvent.MOUSE_DOWN, setAge2);
        ageOpt.opt_3.addEventListener(MouseEvent.MOUSE_DOWN, setAge3);
        ageOpt.opt_4.addEventListener(MouseEvent.MOUSE_DOWN, setAge4);
        ageOpt.opt_5.addEventListener(MouseEvent.MOUSE_DOWN, setAge5);
        ageOpt.opt_6.addEventListener(MouseEvent.MOUSE_DOWN, setAge6);
    function disableButtons():void
        heightBtn.upState = heightBtn.downState;
        heightBtn.enabled = false;
        genderBtn.upState = genderBtn.downState;
        genderBtn.enabled = false;
        ageBtn.upState = ageBtn.downState;
        ageBtn.enabled = false;
        searchBtn.upState = searchBtn.downState;
        searchBtn.enabled = false;
    function enableButtons():void
        heightBtn.upState = heightState;
        heightBtn.overState = heightState;
        heightBtn.hitTestState = heightState;
        heightBtn.enabled = true;
        genderBtn.upState = genderState;
        genderBtn.overState = genderState;
        genderBtn.hitTestState = genderState;
        genderBtn.enabled = true;
        ageBtn.upState = ageState;
        ageBtn.overState = ageState;
        ageBtn.hitTestState = ageState;
        ageBtn.enabled = true;
        searchBtn.upState = searchState;
        searchBtn.overState = searchState;
        searchBtn.hitTestState = searchState;
        searchBtn.enabled = true;
    //ASSORTED FUNCTIONS TO SET THE TEXT FOR THE HEIGHT OPTION
    function setHeight1(event:MouseEvent)
        part1_mc.height_txt.text = "135-145cm";
        enableButtons();
        heightOpt.visible = false;
    function setHeight2(event:MouseEvent)
        part1_mc.height_txt.text = "145-155cm";
        enableButtons();
        heightOpt.visible = false;
    function setHeight3(event:MouseEvent)
        part1_mc.height_txt.text = "155-165cm";
        enableButtons();
        heightOpt.visible = false;
    function setHeight4(event:MouseEvent)
        part1_mc.height_txt.text = "165-175cm";
        enableButtons();
        heightOpt.visible = false;
    function setHeight5(event:MouseEvent)
        part1_mc.height_txt.text = "175-185cm";
        enableButtons();
        heightOpt.visible = false;
    function setHeight6(event:MouseEvent)
        part1_mc.height_txt.text = "Unknown";
        enableButtons();
        heightOpt.visible = false;
    function setGender1(event:MouseEvent)
        part1_mc.gender_txt.text = "Male";
        enableButtons();
        genderOpt.visible = false;
    function setGender2(event:MouseEvent)
        part1_mc.gender_txt.text = "Female";
        enableButtons();
        genderOpt.visible = false;
    function setGender3(event:MouseEvent)
        part1_mc.gender_txt.text = "Unknown";
        enableButtons();
        genderOpt.visible = false;
    function setAge1(event:MouseEvent)
        part1_mc.age_txt.text = "20-30 years old";
        enableButtons();
        ageOpt.visible = false;
    function setAge2(event:MouseEvent)
        part1_mc.age_txt.text = "31-40 years old";
        enableButtons();
        ageOpt.visible = false;
    function setAge3(event:MouseEvent)
        part1_mc.age_txt.text = "41-50 years old";
        enableButtons();
        ageOpt.visible = false;
    function setAge4(event:MouseEvent)
        part1_mc.age_txt.text = "51-60 years old";
        enableButtons();
        ageOpt.visible = false;
    function setAge5(event:MouseEvent)
        part1_mc.age_txt.text = "71-80 years old";
        enableButtons();
        ageOpt.visible = false;
    function setAge6(event:MouseEvent)
        part1_mc.age_txt.text = "Unknown";
        enableButtons();
        ageOpt.visible = false;
    screen_saver.addEventListener(MouseEvent.CLICK, hideScreenSaver);
    function hideScreenSaver(event:MouseEvent):void
        screen_saver.visible = false;
        part1_mc.visible = true;
    //START EXECUTING SEARCH
    searchBtn.addEventListener(MouseEvent.MOUSE_DOWN, startSearch);
    var resultContainer:MovieClip;
    var resultCount:int = 0;
    var position:int = 1;
    function startSearch(event:MouseEvent):void
        resultContainer = new MovieClip;
        part2_mc.addChild(resultContainer);
        disableButtons();
        ageStr = part1_mc.age_txt.text;
        heightStr = part1_mc.height_txt.text;
        genderStr = part1_mc.gender_txt.text;
        searchingDB.visible = true;
        part2_mc.visible = true;
        rightBtn.visible = false;
        leftBtn.visible = false;
        createResults();
    rightBtn.addEventListener(MouseEvent.MOUSE_UP, moveRight);
    leftBtn.addEventListener(MouseEvent.MOUSE_UP, moveLeft);
    function moveRight(event:MouseEvent):void
        if (position < Math.ceil(resultCount/3))
            resultContainer.x = resultContainer.x - 1680;
            position++;
        else
        checkRight();
    function moveLeft(event:MouseEvent):void
        if (position > 1)
            resultContainer.x = resultContainer.x + 1680;
            position--;
        else
        checkLeft();
    function checkRight():void
        if (position < Math.ceil(resultCount/3))
        else
            rightBtn.visible = false;
            if (position > 1)
                leftBtn.visible = true;
    function checkLeft():void
        if (position > 1)
        else
            leftBtn.visible = false;
            if (position < Math.ceil(resultCount/3))
                rightBtn.visible = true;
    function createResults():void
        var resultY = 250;
        var startX = 175;
        resultCount = 0;
        trace(ageStr.substr(0,2), ageStr.substr(3,2));
        trace(startArray[i][2]);
        for (var i:int=0; i < startArray.length; i++)
            if ((parseInt(startArray[i][2]) >= parseInt(ageStr.substr(0,2)) && parseInt(startArray[i][2]) <= parseInt(ageStr.substr(3,2))) || ageStr == "" || ageStr == "Unknown")
                if ((startArray[i][4] >= heightStr.substr(0,3) && startArray[i][4] <= heightStr.substr(4,3)) || heightStr == "" || heightStr == "Unknown")
                    if (genderStr == "" || genderStr == startArray[i][3] || genderStr == "Unknown")
                        var resultItem = new result_item();
                        resultItem.name = "r_" + i;
                        resultItem.name_txt.text = startArray[i][1];
                        resultItem.gender_txt.text = "Gender: " + startArray[i][3];
                        resultItem.height_txt.text = "Height: " + startArray[i][4] + "cm";
                        resultItem.age_txt.text = "Age: " + startArray[i][2];
                        resultItem.description_txt.text = "                                " + startArray[i][5];
                        resultItem.features_txt.y = (resultItem.description_txt.y + resultItem.description_txt.height) + 20;
                        resultItem.features_txt.text = "Distinguishing Features: " + startArray[i][6];
                        var l=new Loader();
                        l.x = l.y = 0;
                        l.load(new URLRequest(startArray[i][0]));
                        resultItem.image_holder.addChild(l);
                        resultItem.y = resultY;
                        resultItem.x = startX;
                        if ((resultCount+1)%3 == 0)
                            startX = startX + 780;
                        else
                            startX = startX + 450;
                        resultContainer.addChild(resultItem);
                        resultCount++;
                        if (resultCount > 3)
                            rightBtn.visible = true;

Maybe you are looking for