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 7003505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:04:39+00:00 2026-05-27T21:04:39+00:00

I am the freshman for flex and actionscript. I want to know when a

  • 0

I am the freshman for flex and actionscript. I want to know when a mobile app initiates, what is the sequence for calling these methods and what are actually they doing separately. I am confused about these functions: creationComplete, activate, viewActivate and addedToStage for begining the app and deactivate and ViewDeactivate for closing the app.

Here is the code I wrote to test about it.

<?xml version="1.0" encoding="utf-8"?>
<s:View viewDeactivate="viewDeactivate()"
    deactivate="deactivate()"
    addedToStage="addedToStage()"
    viewActivate="viewActivate()"
    activate="activate()"
    creationComplete="init()" 
    xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:s="library://ns.adobe.com/flex/spark" title="HomeView" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:flextras="http://www.flextras.com/mxml">
<fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
    <![CDATA[

        private function viewDeactivate():void{
            trace("viewDeactivate");
        }

        private function deactivate():void{
            trace("deactivate");
        }

        private function addedToStage():void{
            trace("addedToStage");
        }

        private function viewActivate():void{
            trace("viewActivate");
        }

        private function init():void{
            trace("creationComplete");
        }

        private function activate():void{
            trace("activate");
        }

    ]]>
</fx:Script>

I just run it on Android mobile phone and the first time I run it and close it, it displays:

creationComplete
viewActivate
addedToStage
viewDeactivate
deactivate

And the then I open and close it again and again, it always displays:

viewActivate
activate
viewDeactivate
deactivate
viewActivate
activate
viewDeactivate
deactivate

Only when I use Android system setting to “force close” the app, then I run it, it again displays:

creationComplete
viewActivate
addedToStage
viewDeactivate
deactivate

So does anybody know why the first time I run it it only display “viewActivate” but no “activate” and for the future when I run it, it displays both but miss “addedToStage” and “creationComplete”? Anybody could tell me what are these functions used for? What things they actually do? And why the sequence displays like that? Also does anybody know what’s the difference between “activate” and “viewActivate” and also “deactivate” and “viewDeactivate“?

Thanks!

  • 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-27T21:04:39+00:00Added an answer on May 27, 2026 at 9:04 pm

    activate event is inherited from EventDispatcher (the default implementation of event dispatching class present in the player runtime). This class is usually extended by other classes if they want to be able to dispatch events. This particular event is dispatched “when the Flash Player or AIR application gains operating system focus and becomes active” Note that it is a broadcast type event, which means that you don’t need to listen to any particular dispatcher, it is invoked on any existing listener.

    addedToStage is dispatched when the listener is added to display list (it’s properties such as stage, parent and loaderInfo are populated and, potentially, it can start receiving interaction events, such as mouse events, touch events etc.) This is one of the basis events available to all display objects.

    viewActivate is a specific to mobile devices event dispatched by classes inheriting from spark.components.View. So far I understand, it is dispatched once the view (which dispatches it) becomes visible to the user.

    creationComplete is a specific to Flex framework event. It will be dispatched by View class mentioned above, because it is an extension of UIComponent, which is the core component of the Flex framework. This event is dispatched once all of the components properties declared in MXML template were set, the component finished it’s validation cycle, being laid out etc.

    Most unfortunately, according to Adobe design you must use Flex framework in order to access certain features on mobile devices. This is why you have that lot of initialization events – the Flex framework is bloated with redundant or very similar classes, functions etc.

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

Sidebar

Related Questions

I'm a college CS freshman who wishes to learn a version control system well.
I’m a freshman on Ruby and now trying to install ruby on my machine
I was thinking back to my freshman year at college (five years ago) when
I've taken a course in C++ in my freshman year in undergrad. However once
I am working now with the Apache Directory Server. I am a freshman in
I'm a bit rusty, actually really rusty with my C++. Haven't touched it since
A while back (freshman year of high school) I asked a really good C++
I'm a freshman in college going for my computer science degree... I've programmed plenty
My brother-in-law is a freshman engineering major in college. He has no prior programming
hey - great coders and haskellers, i'm a haskell freshman and have a problem

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.