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

  • SEARCH
  • Home
  • 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 4338386
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:04:28+00:00 2026-05-21T11:04:28+00:00

Maybe a simple question but I’m having alot of trouble making a button change

  • 0

Maybe a simple question but I’m having alot of trouble making a button change the view of a Flex blackberry playbook app. I am coding it entirely in actionscript, no MXML.

myButton.addEventListener(MouseEvent.CLICK, doSomethingOnClick);

private function doSomethingOnClick(e:MouseEvent):void {
    navigator.pushView(view.Login, "testdata");
}

When I try this I get:

1120: Access of undefined property navigator.

Which is weird as it works in a MXML file. How do I change views in actionscript?

Thanks
Phil

EDIT:
Cheer J_A_X, but now i have:

navigator = new ViewNavigator();
navigator.pushView(net.airpoint.assessments.view.Login, " ");

TypeError: Error #1009: Cannot access a property or method of a null object reference.

Apologies, as I realise this is really simple stuff but it just isnt clicking!

Update 2
*Assessments.as*

package
{
    import flash.display.Sprite;
    import flash.events.Event;

    import net.airpoint.assessments.view.*;

    import qnx.ui.core.Container;
    import qnx.ui.core.ContainerAlign;
    import qnx.ui.core.ContainerFlow;
    import qnx.ui.core.Containment;
    import qnx.ui.text.Label;

    import spark.components.ViewNavigator;

    [SWF(height="600", width="1024", frameRate="30", backgroundColor="#FFFFFF")]

    /* Main Layout */

    public class Assessments extends Sprite
    {
        //containers 
        private var main:Container;
        private var menu:Container
        private var firstLabel:Label;
        private var navigator:ViewNavigator;


        public function Assessments()
        {
            initializeUI();
        }

        private function initializeUI():void
        {
            main = new Container();
            main.padding = Vector.<Number>([20,20,20,20]);
            main.flow = ContainerFlow.HORIZONTAL;
            main.debugColor = 0xFFCC00;

            firstLabel = new Label();
            firstLabel.text = "First label";
            firstLabel.size=35;

            main.addChild(firstLabel);

            addChild(main);

            navigator = new ViewNavigator();
            navigator.pushView(Login, " ");

        }
    }
}

Login.as

package net.airpoint.assessments.view
{
    import flash.display.Sprite;
    import flash.events.MouseEvent;

    import qnx.ui.buttons.Button;
    import qnx.ui.core.Container;
    import qnx.ui.text.Label;
    import qnx.ui.text.TextInput;

    import spark.components.View;

    public class Login extends View
    {

        private var usernameLabel:Label;
        public function Login()
        {
            initializeUI();
        }

        public function initializeUI():void
        {
            usernameLabel.text = "test";

            this.addChild(usernameLabel);
        }               
    }
}
  • 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-21T11:04:29+00:00Added an answer on May 21, 2026 at 11:04 am

    Something isn’t right. If it’s a Flex Mobile Project, you need an Application at the top level (you know, like how Flash Builder created the project with an mxml file). Either you create an actionscript file that extends Application as mentioned here or you just use an mxml file for the root component.

    However, your argument to ‘not use mxml’ is redundant if you’re using Flex components. If you’re using Flex components, you’re using mxml no matter what, so there’s no performance increase. If anything, RIM is recommending to use AS only because their SDK is AS only (which is idiotic anyways). You could always add their UI component through AS in mxml files.

    So really, the point is moot and you should just use mxml anyways since it’s better than straight AS for UI layout and skinning. Either that or go Pure AS with no Flex components.

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

Sidebar

Related Questions

simple question maybe but can't find solution. I have button for refresh/update some contents
Maybe this is a simple question, but I'm trying to change the position of
Ok so this maybe a simple/silly question but I don't know so here goes:
Simple question, but could somehow not find any answer on google (maybe it's just
Maybe my question it's a little weird, but I'm trying to build a not-so-simple
This maybe a really simple question but for some reason my code isn't working.
Maybe, it's very simple question but I couldn't get the answer. I've been searching
I new to ASP.NET MVC so this question maybe simple for you but please
Maybe this is a simple question, but I didn't find answer in web. I
Maybe it's a simple question but I didn't succeed to solve it. DNSperf is

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.