Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6012757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:27:00+00:00 2026-05-23T02:27:00+00:00

I have to use a menu in my actionscript project (FLARManager + Away3D) and

  • 0

I have to use a menu in my actionscript project (FLARManager + Away3D) and I want to use a combobox. I try but I fail.

My simple code is

import spark.components.ComboBox;
import mx.collections.ArrayCollection;

public class MyComboBox extends ComboBox
{
    public function MyComboBox()
    {
        super();

        var dp_ac:ArrayCollection = new ArrayCollection([ 
            {label: "test 1"}, 
            {label: "test 2"}, 
            {label: "test 2"}
        ]);
        this.dataProvider = dp_ac;
        this.labelField = "label";

        this.x=200;
        this.y=-200;
        this.width=20;
        this.height=10;
    }
}

Then, in my project file I code:

import aplicacion.MyComboBox;

import artedra.*;

import com.transmote.flar.FLARManager;
import com.transmote.flar.marker.FLARMarker;
import com.transmote.flar.marker.FLARMarkerEvent;
import com.transmote.flar.tracker.FLARToolkitManager;

import flash.display.Sprite;
import flash.events.Event;
import flash.events.KeyboardEvent;

import spark.components.ComboBox;
import spark.components.Group;

[SWF(width="800", height="600", frameRate="30", backgroundColor="#C0C0C0")]

/**
 * 
 * @author Iago Laz
 * 
 */ 
public class ARapp extends Sprite {
    private var flarManager:FLARManager;
    private var activeMarker:FLARMarker;
    private var artedraManager:IARTeDraManager = new ARTeDraManager(stage);

    private var targetDetected:Boolean = new Boolean(false);
    private var next:Number = ARTeDraManager.GRID;

    public function ARapp () {          
        addEventListener(Event.ADDED_TO_STAGE,onAdded);     
    }

    private function onAdded (evt:Event) :void {
        removeEventListener(Event.ADDED_TO_STAGE,onAdded);
        flarManager = new FLARManager("../resources/flarConfig.xml",new FLARToolkitManager(),stage);

        flarManager.addEventListener(FLARMarkerEvent.MARKER_ADDED,onMarkerAdded);
        flarManager.addEventListener(FLARMarkerEvent.MARKER_UPDATED,onMarkerUpdated);
        flarManager.addEventListener(FLARMarkerEvent.MARKER_REMOVED,onMarkerRemoved);

        flarManager.addEventListener(Event.INIT,onFlarManagerInited);
    }

    private function onFlarManagerInited (evt:Event) :void {
        flarManager.removeEventListener(Event.INIT,onFlarManagerInited);

        artedraManager.showModel();
        artedraManager.showViews();
        artedraManager.showGridDots(ARTeDraManager.GRID);

        var g:Group = new Group();
        var cb:MyComboBox = new MyComboBox();
        g.addElement(cb);

        stage.addEventListener(KeyboardEvent.KEY_DOWN,reportKeyDown);
        stage.addEventListener(Event.ENTER_FRAME,onEnterFrame);
    }

    private function reportKeyDown(event:KeyboardEvent):void {
        if(event.keyCode==32) {
            if(next==ARTeDraManager.DOTS)
                next=ARTeDraManager.EMPTY;
            else
                next++;
            artedraManager.showGridDots(next);
        }
    } 

    private function onMarkerAdded (evt:FLARMarkerEvent) :void {
        trace("["+evt.marker.patternId+"] added");
        activeMarker = evt.marker;
        targetDetected = true;
    }

    private function onMarkerUpdated (evt:FLARMarkerEvent) :void {
        activeMarker = evt.marker;
        targetDetected = true;
    }

    private function onMarkerRemoved(evt:FLARMarkerEvent):void
    {
        trace("["+evt.marker.patternId+"] removed");
        activeMarker = null;
        targetDetected = false;
    }

    private function onEnterFrame(evt:Event):void {
        if(activeMarker) {
            artedraManager.rotateShapes(activeMarker.rotationZ);
        }
        artedraManager.showSphereMarkerDetected(targetDetected);
        artedraManager.renderScenes();
    }
}

But it doesn’t show anything. I think I’m missing something but I don’t know what.

Can anyone help me, please?

Edit with error message:

TypeError: Error #1009: No se puede acceder a una propiedad o a un m賯do de una referencia a un objeto nulo.
at mx.styles::StyleManager$/getStyleManager()[E:\dev\4.x\frameworks\projects\framework\src\mx\styles\StyleManager.as:125]
at mx.styles::StyleProtoChain$/getStyleManager()[E:\dev\4.x\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:970]
at mx.styles::StyleProtoChain$/initProtoChain()[E:\dev\4.x\frameworks\projects\framework\src\mx\styles\StyleProtoChain.as:149]
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::initProtoChain()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\UIComponent.as:10446]
at mx.core::UIComponent/regenerateStyleCache()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\UIComponent.as:10509]
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::addingChild()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\UIComponent.as:7213]
at mx.core::UIComponent/addChildAt()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\UIComponent.as:6943]
at spark.components::Group/addDisplayObjectToDisplayList()[E:\dev\4.x\frameworks\projects\spark\src\spark\components\Group.as:1825]
at spark.components::Group/http://www.adobe.com/2006/flex/mx/internal::elementAdded()[E:\dev\4.x\frameworks\projects\spark\src\spark\components\Group.as:1416]
at spark.components::Group/addElementAt()[E:\dev\4.x\frameworks\projects\spark\src\spark\components\Group.as:1183]
at spark.components::Group/addElement()[E:\dev\4.x\frameworks\projects\spark\src\spark\components\Group.as:1141]
at aplicacion::ARapp/onFlarManagerInited()[C:\Users\Iago\workspace\PFG_ARTeDra\src\aplicacion\ARapp.as:75]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.transmote.flar::FLARManager/onTrackerComplete()[C:\Users\Iago\workspace\PFG_ARTeDra\src\com\transmote\flar\FLARManager.as:1098]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.transmote.flar.tracker::FLARToolkitManager/onTrackerComplete()[C:\Users\Iago\workspace\PFG_ARTeDra\src\com\transmote\flar\tracker\FLARToolkitManager.as:384]
at com.transmote.flar.tracker::FLARToolkitManager/initTracker()[C:\Users\Iago\workspace\PFG_ARTeDra\src\com\transmote\flar\tracker\FLARToolkitManager.as:332]
at com.transmote.flar::FLARManager/onTrackerInited()[C:\Users\Iago\workspace\PFG_ARTeDra\src\com\transmote\flar\FLARManager.as:1080]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.transmote.flar.tracker::FLARToolkitManager/checkForInitComplete()[C:\Users\Iago\workspace\PFG_ARTeDra\src\com\transmote\flar\tracker\FLARToolkitManager.as:374]
at com.transmote.flar.tracker::FLARToolkitManager/onPatternsLoaded()[C:\Users\Iago\workspace\PFG_ARTeDra\src\com\transmote\flar\tracker\FLARToolkitManager.as:364]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.transmote.flar.pattern::FLARPatternLoader/checkForLoadCompletion()[C:\Users\Iago\workspace\PFG_ARTeDra\src\com\transmote\flar\pattern\FLARPatternLoader.as:205]
at com.transmote.flar.pattern::FLARPatternLoader/onPatternLoaded()[C:\Users\Iago\workspace\PFG_ARTeDra\src\com\transmote\flar\pattern\FLARPatternLoader.as:197]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T02:27:01+00:00Added an answer on May 23, 2026 at 2:27 am

    Based on the code, I’m guessing you aren’t sizing the ComboBox by setting the height and width properties or giving it a position by setting the x and y properties.

    Both of these things are most commonly done in the updateDisplayList method. In the Spark architecture updateDisplayList() is usually implemented in the skin class.

    More info:

    http://livedocs.adobe.com/flex/3/html/help.html?content=ascomponents_advanced_2.html

    http://help.adobe.com/en_US/flex/using/WS460ee381960520ad-2811830c121e9107ecb-7fff.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have something like this, $(a[rel^='prettyPhoto']).prettyPhoto({ theme: 'light_square' }); but then I use $('.menu').click(function()
For example, I have node/31. And I want drupal to set menu active item
I have a menubar and tabs the code like below: <div id=menu> <ul> <li><a
I have a long page and use a menu to navigate to different parts
I made a style for my menu control and now I want to use
I've been trying to use ASP:Menu.SelectedValue property but it is not working so if
I am working on a website where I have to use dynamic navigation menu
I have created an input that creates divs to use as menu items. These
I want to use ribbon menu(as on Microsoft Word 2007 or 10) in my
I have a simple (excercise) website whose structure consist of a content selection menu

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.