include the component in the State with AS3

Hi I have a tab navigator that I instantiated in my AS3 code.  I want to make this browser tab display only in some countries, but not all. How can I do this?  Obviously with mxml I can add a property 'includeIn' and assign which has it should be visible, but how would I do this in ActionScript?   Thank you, fuyuko

The States are a concept MXML, not a concept of ACEs. In AS, you would use what logic allows you to change your status, and then do the things you want to happen next.

override public function set currentState(value:String):void

{

super.currentState = value;

do things with a bunch of instructions conditional mess

}

The above doesn't look natural.

If you are interesting in creating features like State in AS native, you can look in the Model of Memento.

Tags: Flex

Similar Questions

  • Change the text with AS3 makes the invisible text

    Hi all

    Even for a total n00b like me, this is awkward: I can't even change a text on the stage with as3.

    I place a text on my stage, assign the dynamics, incorporate the police and give it an instance name. When I change the text, he evacuated the scene or if it remains invisible, I don't know.

    I thought it would be as simple as this: myText.text = "new text";   but apparently I am doing something wrong. When I put a trace (myText.text);  before and after, I see the old and the new text in the output window. Then he changes correctly, but why he disappears it? Also tried in a new white project, to ensure that it was not something somewhere.

    I'm totally distraught...

    BTW I use Flash CS5.5 on Win7

    do not enter text in the ide.  Use actionscript to assign the original text of your textfield and also change.

  • How to create a button in the State with two different images?

    What I mean is... I have a picture that is conveyed as a button that has not been pressed, and I also have an image that expresses the same key but this time it is pressed. Is there a way to ensure that when the button is normal I seized the image of the button upward and then make sure that when I roll on or press the Enter key, the image of the button down?

    Thank you, Ben Charter

    Hi Ben,

    Just create a Menu and with the Normal State is selected, use the fill options to fill an image in the Menu item. Select the rollover / the mouse to the bottom of the State in the States Panel, then assign an image by using the options to fill again. This is a swap of base image using normals and States of Muse down mice.

    Kind regards

    Akshay

  • Adjust the order of the layers with AS3

    I want to load an external SWF into my project. I do this by adding a charger to the scene. It seems above all, there are 16 layers in my FLA, and I want to put it between the second and the third to the lower layers. How can I do this? I looked at some things online but they are all to change the order of objects on the same layer, and they usually invole do 2 or three objects with AS3 then change the order on the same layer, always above the objects that are actually on the stage of the FLA. I want to put the SWF loaded under Of OBJECTS ALREADY EXISTING that are on different layers.

    My code:

    var pageLoader:Loader = new Loader;

    addChild (pageLoader);

    pageLoader.x = 98;

    pageLoader.y = 121;

    pageLoader.z <-as far as I know it works in a single layer, it won't jump from layer to layer.

    Some have suggested to load my swf in a clip from movie ampty bt when I do this I lose interactivity for swf file, why is this and is there away around this?

    My code:

    var pageLoader:Loader = new Loader;

    pageContainer.addChild (pageLoader);

    pageContainer is an empty movie clip

    I want to load directly to the scene and just change the layer (first method), but if this cannot be done so I need a way to get SWFs loaded into a clip vacuum film and keep their own interactive.

    I dound in connection addChildAt, which is different from addChild, because it has 2 parameters, the name of the object and its z-index. So I was able to do:

    addChildAt(pageLoader,4);

    Then I met the same problem with movie clip method is empty, I lost interactivity. Then I noticed that there movieclips above because one of them is used as a blending mode by covering it. So, I realized that the empty movie clip method did not work because there are video clips above it. So I did mouseEnabled = false. And it works, so YAY!

  • Select all the text in the control with AS3

    Does anyone know how to select all the text in a text control (text, textarea, etc.) with AS3?

    Thank you.

    Answered my own question.

    Set the properties selectionBeginIndex and selectionEndIndex of text controls.

    For example, this selects all the text in a text box:
    yourTextArea.selectionBeginIndex = 0;
    yourTextArea.selectionEndIndex = yourTextArea.text.length;

  • I can reply to messages without including the message with the answer?

    In Microsoft Outlook, there is an option to include the incoming response message, or do not include the incoming message. Is there an option in Thunderbird? I can't find it in Options.

    Large. You will mark this one resolved.

  • decode the statement with. «, » ||

    Hello
    I have the requriement next where I need to join the 2 numbers with comma inside the decode stmt
    create table  A_STY_VON ( C_1_ID number ,C_2_ID number ,C_3_ID number)
    
    Insert into A_STY_VON
       (C_1_ID, C_2_ID, C_3_ID)
     Values
       (1, 2, 3);
    Insert into A_STY_VON
       (C_1_ID, C_3_ID)
     Values
       (1, 3);
    Insert into A_STY_VON
       (C_1_ID, C_2_ID)
     Values
       (1, 2);
    Insert into A_STY_VON
       (C_2_ID, C_3_ID)
     Values
       (2, 3);
    And the following select stmt does not work
    SELECT   DECODE (
              A.C_3_ID,
              NULL, DECODE (A.C_2_ID,
                            NULL, A.C_1_ID,
                            A.C_1_ID || A.C_2_ID) ,
                 A.C_1_ID
             || A.C_2_ID
             || A.C_3_Id) dcd
      FROM A_STY_VON A 
    But I want the comma between the numbers so I tried the following (with separate)
    where I get the error invalid number
    SELECT  distinct DECODE (
              A.C_3_ID,
              NULL, DECODE (A.C_2_ID,
                            NULL, A.C_1_ID,
                            A.C_1_ID ||','|| A.C_2_ID) ,
                 A.C_1_ID
              ||','|| A.C_2_ID
              ||','|| A.C_3_Id) dcd
      FROM A_STY_VON A 
    Could you please help me to achieve this

    Thank you

    Published by: Smile on April 26, 2012 03:50

    A rough solution will add to_char everywhere.

    SELECT  distinct DECODE (
              to_char(A.C_3_ID),
              NULL, DECODE (to_char(A.C_2_ID),
                            NULL, to_char(A.C_1_ID),
                            to_char(A.C_1_ID) ||','|| to_char(A.C_2_ID)) ,
                 to_char(A.C_1_ID)
              ||','|| to_char(A.C_2_ID)
              ||','|| to_char(A.C_3_Id)) dcd
      FROM A_STY_VON A
    
  • loading movie clip to the stage with AS3 button click

    I'm trying to figure out how to load a clip to the scene with a click of a button and have the movieclip close again with a close button. Does anyone have a step by step on how to do this or links to tutorials.

    Here is an example of what I'm trying to do.

    http://i30.photobucket.com/albums/c316/good_snow/FlashBoxSample_zps4e655414.jpg

    Looks like you are using a 'el' and a 'single '.  they are similar, but they are not the same.

    copy and paste from your code to your properties panel or vice versa to correct.

  • XML to fill some movieclips added to the scene with AS3

    OK, I am new to AS3 and it's the biggest thing that I tried to do.

    I'm just at a loss for the right path to take to achieve what I want to do.

    In short, here is what the final result will look like:

    The scene contains a large (about X size) movieclip with a scroll bar (not important for this discussion). This movieclip is created using AS3.

    The large movieclip is filled with many small movieclips created from a template in the library. This model contains certain dynamic text fields (let's call them text1_MC and text2_MC). Dynamic text for each small movieclip is provided of an XML file that contains the text and text1 2 data.

    I was watching tutorials to dynamically add a text as well as the instructions of plotting xml data analysis and others. What I can't find is how add dynamically the text to a text field in a movieclip and then add the movieclip on the stage and then start everything for the next bit of data.

    What we call this process? I know that I am using a loop statement, but someone could give me an overview of all the different things I do to get my data on xml, fill a single movieclip, and then adding this movieclip to the greatest MC, then doing that everywhere for all xml entries I've got, then adding that great MC on the stage?  I would be happy to get it all myself.

    Thank you!

    Hello

    You have created a single object. Only, I changed your code. pls watch it.

    var Timeline_mc:MovieClip = new Timeline_MC();

    var flag: Flag_MC.

    function ParseFlags(flagInput:XML):void
    {
    var locationList:XMLList = flagInput.Flag.Location;
    var titleList:XMLList = flagInput.Flag.Title;
    var actionList:XMLList = flagInput.Flag.Action;
    for (var i: int = 0; i< locationlist.length();="">
    {

    flag = new Flag_MC();

    var locationElement: Number = locationList [i];
    var titleElement:XML = titleList [i];
    var actionElement: XML = actionList [i];
    Flag.txt_title. Text = (titleElement);
    Flag.txt_intro. Text = (actionElement;)
    Flag.x = (location element);

    Timeline_mc. AddChild (flag); / /[i] ;

    }
    }

    addChild (Timeline_mc);

    Thank you

    Concerning

    Bala.S

  • Remove the statement with subquery with more than 1 columns

    Hi all

    I want to delete the data in the kpi_logs table for which the kpi_def_id column is less than the max (timestamp). The timestamp is the date data type. I wrote below query but its throwing an error as an SQL error: ORA-00936: lack of expression.

    DELETE FROM KPI_LOGS WHERE (Select MAX (TIMESTAMP), KPI_DEF_ID of the KPI_DEF_ID KPI_LOGS GROUP);

    Hello

    user12251389 wrote:

    I want to delete the data in the kpi_logs table for which the kpi_def_id column is less than the max (timestamp). The timestamp is the date data type. I wrote below query but its throwing an error as an SQL error: ORA-00936: lack of expression.

    DELETE FROM KPI_LOGS WHERE (Select MAX (TIMESTAMP), KPI_DEF_ID of the KPI_DEF_ID KPI_LOGS GROUP);

    Whenever you have a question, please post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and the accurate results you want from this data, so that people who want to help you can recreate the problem and test their ideas.

    If you ask about a DML operation, such as DELETE, and INSERT statements, you post should show what looks like the tables before the DML, and the results will be the content of the table changed after the DML.

    Explain, using specific examples, how you get these results from these data.

    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum:

    You want to keep only the maximum timestamp for the entire table, or you want the maximum timestamp for each distinct value of kpi_def_id?

    If it is just the maximum timestamp for the whole picture, then

    DELETE FROM kpi_logs

    WHERE the timestamp<>

    SELECT MAX (timestamp)

    OF kpi_logs

    );

    If you want to keep the maximum timestamp for each individual value phew kpi_def_id, then:

    DELETE FROM kpi_logs

    WHERE (kpi_def_id, timestamp NOT IN)

    SELECT kpi_def_id

    MAX (timestamp)

    OF kpi_logs

    GROUP BY kpi_def_id

    );

    assuming that no column can be NULL.

    Moreover, the TIMESTAMP is a data type, similar to this DAY.  You'll only cause confusion by saying it is a type of data when it is really another.  In addition, TIMESTAMP is a keyword from Oracle, is not a very good column name.  Why not give your column a name more meaningful, accurate, such as create_date or entry_dt?

  • Insert the statement with &amp; in the chain

    Hello

    When you use the insert in varchar2 column having below value, it's the slightest mistake out.
    But, if I remove & symbol... It's inclusion.
    suggestions to insert any string

    "Networking - Cisco SMARTnet-6600 | Security & Switch Service Cont-6620 | Not used-0000"

    Thank you

    use

    SET DEFINE OFF

    before the insert statement.

    Concerning
    Arun

  • Get the library MovieClip is on the scene with AS3

    Hey guys, a simple I think, right

    Could I please have the answer to get an element of MovieClip on the stage within say the class Document.

    The trick is

    I want to do when the MovieClip is link refers to a class name, but doesn't actually have a document class that is created.

    I know you can give a complete class with the document and which would not be easy.  But if you have 10 enemy objects literally doing the same thing, but just look different, why create 10 separate classes!

    or I am barking the wrong tree and that I should just set up 10 different enemy styles in the MovieClip 1 and just 1 class join her?

    Although always, I would like to know how to get dynamically a MovieClip on the stage of the library, when he isn't a class file associated with the class name in the link

    I saw that somewhere there are many moons but do not remember how it was done: s

    Thanks in advance

    Pocketninja

    I'll spare you any attempt by me to answer the questions of the Document class, but here are the basics to dynamically load a symbol in the library...

    First of all you must designate the object in the library as an element that can be dynamically loaded.

    Right-click on it in the library and select the link in the menu that appears. In the interface that appears, select export for Actionscript. A class name will be automatically assigned, you can change as you wish (let's just say you name MyObject). Is the name you will use to call in the library item.

    When you click OK to close this interface, it can come up with an indication saying that he finds not only the class so it will create a moment complie... click OK here.  You are made to prepare the object in the library.

    To add the item to the scene, treat it like any other new object instance:

    var newObject:MyObject = new MyObject();
    newObject.x =... etc...
    this.addChild (newObject);

  • Help looping of the States with a timer

    When the timer goes off I need to move to the next State.  Y at - it an easy way to tell it to go to the next State or what I need to determine the current state and set the next State?

    If I go the second route how would - this code be?

    private void onTimer(evt:TimerEvent):void
    {
    If (currentState is "life sciences")

    <!-How can I say this 'lifestyle' the new State do? ->
    }

    except "this.states" every thing must be your custom name (myStates)... I'm tlking on the next line... Sorry for writing the code so confused...

    if(States == null) States = this.states;

  • Change the width of the line with AS3?

    So, I have a clip that consists of a full circle of vector a. Is it possible to increase/decrease the race to a specific in pixels with actionscript thickness while playing the swf?

    Thank you

    T

    If you draw a circle dynamically using graphics API then its possible to display the race using the lineStyle method.

    But if this circle has already been designed and placed in step, I don't think you can change his race.

    Can I ask, why don't draw you dynamically using actionscript. It's so easy.

    Make sure you import relavent API

    import flash.display.LineScaleMode;
    import flash.display.CapsStyle;
    import flash.display.JointStyle;

    public var _cricleObj: Sprite;

    public var _lineSize: number = 1;

    Now, draw your circle

    _cricleObj = new Sprite();

    _cricleObj.Graphics.LineStyle (_lineSize, 0xFFFF00, 1, false, LineScaleMode.VERTICAL, CapsStyle.NONE, JointStyle.MITER, 3);

    _cricleObj.Graphics.beginFill(0xFF,1);
    _cricleObj.Graphics.drawCircle (0,0,50);
    _cricleObj.Graphics.endFill ();

    _cricleObj.addEventListener (Event.ENTER_FRAME, reDrawCircle);

    public void reDrawCircle(e:Event):void
    {
    _lineSize += 1;
    _cricleObj.Graphics.clear ();
    _cricleObj.Graphics.LineStyle (_lineSize, 0xFFFF00, 1, false, LineScaleMode.VERTICAL, CapsStyle.NONE, JointStyle.MITER, 3);
    _cricleObj.Graphics.beginFill(0xFF,1);
    _cricleObj.Graphics.drawCircle (0,0,50);
    _cricleObj.Graphics.endFill ();

    }

    That's all.

  • Remove the statement with a subquery

    Hi Experts,
    I currently have a select query with subquerys, I want to turn it into a deletion request.
    select cy.lmp, cy.dt from 
    
    (SELECT LMP, CHANGE_SD, ADD_MONTHS(DT,12) AS DT 
    FROM FORECAST WHERE EVENT = 'GROWTH RATE') ny --next year,
    
    (SELECT LMP, CHANGE_SD,  DT 
    FROM FORECAST WHERE EVENT = 'GROWTH RATE') cy -- current year
    
    where ny.change_sd = cy.change_sd and ny.dt = cy.dt and ny.lmp = cy.lmp
    order by cy.lmp;
    Here, I want to delete rows from the table the forecasts which are the result of the select query above.

    Your help is appreciated.

    Hello

    Will there be matching columns in the forecast table?
    If so, you can do this:

    DELETE  forecast
    WHERE   (column_a, column_b) IN
    (SELECT  cy.lmp,   cy.dt
     FROM    ...     -- rest of query (except ORDER BY clause) goes here
    );
    

Maybe you are looking for