Problem with switch statement

Salvation;

I have this code:

function AddURLToImage(e:Event):void
{
trace (e.Target.Name);
Switch (e.target.name)
{
case img0:
trace ('xxx');
var url = new URLRequest (_firstImageInArrayURL);
img0Sprite.addEventListener (MouseEvent.CLICK, function() {navigateToURL (url)});
URL = null;
break;
...

The first trace traces all img names:

img0

img1

img2

...

img5

However, even if any of the image have trace('xxx') in them, none of them does plot. Please help me to see what I'm doing wrong.

TIA,

Beno

Try to use quotation marks around the names of your case.  The names are strings, not bodies

Tags: Adobe Animate

Similar Questions

  • Problem with the State showed up in BB10

    Hello

    After the upgrade of my DevAlpha to the latest version, 10.0.9.1675, I have problems with 2-State buttons.

    Example code:

    #myBtn{
        background-image: url(btn/myBtn.png);
        background-repeat: no-repeat;
        background-position: 0px 0px;
    }
    #myBtn:hover{
        background-position: 0px -124px;
    }
    

    So, when I click the button it stay frozen until steady-state, does not return to the default position. All my apps of ww are affected by this problem.

    Anyone can attempt to reproduce this problem?

    If so, what is the solution?

    This is sort of the standard: hover behaviour I noticed in mobile browsers. Since then no cursor, hover is only simulated.

    The simplest solution (and the one I use in my projects) is to use: active instead of: hover.

    #myBtn:active{
        background-position: 0px -124px;
    }
    
  • Problem with switching screens

    Hello, I have a problem with switching screens. Here is my code (both screens extends screen):

    SerializableAttribute public class Main extends UiApplication {}

    Private TrainLinkScreen trainLinkScreen;
    Private WorkingScreen workingScreen;
    private string;

    Public Shared Sub main (String [] args) {}
    new hand (.enterEventDispatcher ());
    }

    public Main() {}
    workingScreen = new WorkingScreen();
    pushScreen (workingScreen);

    try {}
    trainLinkScreen = new TrainLinkScreen();
    } catch (GpsException ex) {}
    message = ex.getMessage ();
    } catch (FileException ex) {}
    message = ex.getMessage ();
    }
    If (message! = null &! message.equals("")) {}
    invokeLater (new Runnable() {}

    public void run() {}
    Dialog.Alert (message);
    System.Exit (1);
    }
    });
    } else {}
    popScreen (workingScreen);
    pushScreen (trainLinkScreen);
    }
    }
    }

    The problem is that the workingScreen is not displayed. The download takes a little time, so I wanted to put here a screen like "I work, please wait...". ", but he appears, the unit freezes for a few seconds and then the trainLinkScreen appears. Could someone please write where is the problem? I tried invokeLater on the first screen, but it ends with the crash on popScreen (trainLinkScreen). I tried invokeLater on trycatch also block, but it does not work either. Help, please.

    Thank you. I already have the solution (I hope that ), I put to device gps location in a separate method (it's a small part of the code that does not have too much time to finish), she called before initialization and initialization in method invokeLater as a thread (the large part, too download from the internet). The display works perfectly in this way (in the first place, the "Download" screen appears and then comes the rest of the code) Although some other things seems to not work properly now

  • Problem with switch Cisco SG300

    Hi guys,.

    I have a problem with switch Cisco SG300-20. After the failure of the switch boots in a kind of mode. It requires

    MAC address and serial number to be entered manually for the device. I tried to find information on this mode, but without success.

    My question is: what is this mode and how to make the start switch in this mode?

    How can I turn on the switch in this mode on purpose if it happens again and I enter the wrong information by accident.

    Thank you

    Hi Aegx, this is a rare case where the switch basically forget his identity. Although the switch is recoverable, it is recommended the switch RMA.

    If you are certain that you have neither taken under warranty, all the information that is asked is on the bottom of the switch sticker. If the thumbnail is is not present you wouldn't able to do this is correct.

    In addition, if you make a typographical error, the switch will have undesirable failures that are permanent, such as the inability to update software.

  • Problem with diagram State Toolkit 1.0 - LV 8.2 upgrade to 2014

    I'm in transition a large amount of code from Labview 8.2 to 2014, and I'm having a problem with state diagrams have been added using the state diagram Toolkit V1.0.

    The figure below shows the question, Labview knows the loop and its components are associated with a state diagram, but it option to change the schema, "change the state diagram," is not available.  In Labview 8.2, which I am currently running on older machines, I would simply select "Change the state diagram" and another window of each State and arrows between States appears, allowing the mounting of the diagram.

    I think I have to install the state diagram Toolkit V1.0 software, but it is no longer available on the Web site of NOR.  There are new States transitions module I installed, but it is significantly different from the old Toolbox and does not support.  Any recommendations?

    Thank you very much
    Phil

    Good news:

    (1) SDE still works with SP1 LV2014.

    (2) I have the installer and I'm ready to send it to you. Please send me a private message with your email address.

    Be sure to support this idea.

  • problem with loop statement

    Hello

    I'm new in plsql, so I need your help. I am rewriting the existing plpgsql function plsql function, but I have an error on line 15: PLS-00103: encountered the symbol "LOOP" when expecting one of the following values:

    What is the problem with the LOOP statement?

    FUNCTION to CREATE or REPLACE dothework (service_name text string_value)

    RETURNS the text AS

    BEGIN

    DECLARE

    result text;

    varying (31) of tempId character;

    tempFieldId bigint;

    text of tempStringValue;

    tempCount bigint;

    BEGIN

    result = ";

    FOR IN tempId

    SELECT ce.id FROM mfc.card_element this

    WHERE the ce.name AS service_name

    LOOP

    tempCount = 0;

    SELECT INTO tempFieldId mfc.card_field CF field_id

    WHERE cf.field_name = 'NPAname ';

    SELECT INTO tempCount count (*) FROM mfc.card_element_field_value cefv

    WHERE the cefv.card_element_id AS a tempId AND field_id = tempFieldId;

    IF tempCount = 1 THEN

    UPDATE mfc.card_element_field_value

    SET field_string_value = string_value

    WHERE the card_element_id AS a tempId AND field_id = tempFieldId;

    result: = result | tempId | 'UPDATE - YES,';

    ELSIF tempCount = 0 THEN

    INSERT INTO mfc.card_element_field_value (id, field_date_value, field_integer_value, field_string_value, card_element_id, field_id)

    VALUES (HIBERNATE_SEQUENCE.nextval,

    NULL,

    NULL,

    string_value,

    tempId,

    tempFieldId);

    result: = result | tempId | "INSERT - YES, ';

    ON THE OTHER

    result: = result | tempId | "tempCount,";

    END IF;

    -END IF;

    END LOOP;

    RETURN result;

    END;

    END;

    I did the same refatoring I program you unit and put comments to help to understand.

    Let me know if it help you

    FUNCTION to CREATE or REPLACE dothework (service_name in VARCHAR2

    string_value IN VARCHAR2) RETURN VARCHAR2 AS

    -Not necessary to define the new block here BEGIN-

    -SAYS - you only need the instruction stated in this case if you

    -believe that he can raise one exceptional and you want to manage block outsider

    --

    -You must set the buffer of varchar2

    -32767 is the largest amount

    RESULT VARCHAR2 (32767).

    --

    -You can dock this type for the column type, you will receive the data

    tempfieldid card_field.field_id%TYPE;

    -tempstringvalue VARCHAR2; -you do not use this variable

    tempcount NUMBER;

    BEGIN

    -You don't need to initialize with NULL, in this case. PLSQL has done already for you

    -THE RESULT: = ";

    --

    -It seems to me that this request can be outside of the loop

    -Once the table is not the change and the predicate doenst change is

    SELECT field_id

    IN tempfieldid

    Card_field FC

    WHERE cf.field_name = 'NPAname ';

    --

    FOR tempid IN (SELECT ce.id

    OF card_element this

    WHERE the ce.name AS service_name) LOOP

    -It is not necessary to initialize this variable to zero

    -tempcount: = 0;

    --

    --

    SELECT COUNT (*)

    IN tempcount

    OF card_element_field_value cefv

    WHERE the cefv.card_element_id AS a tempid

    AND field_id = tempfieldid;

    --

    IF tempcount = 1 THEN

    UPDATE card_element_field_value

    SET field_string_value = string_value

    WHERE the card_element_id AS a tempid

    AND field_id = tempfieldid;

    RESULT: = RESULT | tempid | 'UPDATE - YES,';

    ELSIF tempcount = 0 THEN

    INSERT INTO card_element_field_value

    (id

    field_date_value

    field_integer_value

    field_string_value

    card_element_id

    field_id)

    VALUES

    (hibernate_sequence.nextval

    NULL

    NULL

    string_value

    tempid

    tempfieldid);

    RESULT: = RESULT | tempid | "INSERT - YES, ';

    ON THE OTHER

    -I remove the tempCount on the "because I think you want to see the number of records

    -you do business with

    RESULT: = RESULT | tempid | ' ' || tempCount | ', ';

    END IF;

    END LOOP;

    RETURN RESULT;

    -END;

    END;

    Best regards

  • Problem with Decode statement

    Hello

    I try to do the following in my report:

    If an employee is a family name. (dot) or a name of. (dot), the report does not display a point. An employee name consists of the family name, first name and middle name, which should all be concatenated sets. An attempt to achieve this goal, I have the following statement in my report:

    Decode (e.Surname, '.', (LTRIM (RTRIM ((INITCAP (e.FIRST_NAME))) |))) » '|| INITCAP (e.MIDDLE_NAME))),
    e.FIRST_NAME, '.', (LTRIM (RTRIM ((INITCAP (e.Surname))) |)) » '|| INITCAP (e.MIDDLE_NAME))),
    (LTRIM (RTRIM ((INITCAP (e.SURNAME))) | ',' |)) INITCAP (e.first_name) | » '|| INITCAP (e.MIDDLE_NAME))) as emp_name

    E employee

    Problem: The above statement only works for employees with the name of. (dot). It doesn't for the first names of dot. How to use the decode statement OR is there another way to do it without using the CASE statement?

    It seems my decode statement does not work with 2 different fields (name, first name) tested within the decode statement. Thank you.

    LTRIM and RTRIM the comma too:

    select rtrim(ltrim(rtrim(ltrim(', Somename ,',','),','))) Name
    from dual;
    
    NAME
    --------
    Somename
    
  • problem with if statement

    I have problem with this code haven. It shows error illigical use of the else statement. I checked the syntax is at but I don't where is my problem

    I have a drop drop list box. If the user selects objects in textfields txt_contract1 & txt_contract2 of named values has the new change.iam of java script. is it possible to programmetically edit from vb.net. IAM familiar with it.

    DataRoot. Transmittal_pdf. DropDownList1::click - (JavaScript, client)

    If

    (xfa.event.newText == 'Strategic') { }

    XFA. Form.DataRoot._Transmittal_pdf.

    DataRoot._Transmittal_pdf. Table5.row2.txt_contract1. Value

    = "Blueprint of strategic roads."

    DataRoot._Transmittal_pdf. Table5.row2.txt_contract2. Value

    = "These immediate plans."

    }

    on the other

    {

    DataRoot._Transmittal_pdf. Table5.row2.txt_contract1. Value

    = "Held consultation projects;

    DataRoot._Transmittal_pdf. Table5.row2.txt_contract2. Value

    = "";

    }

    Hi Prasad,

    'V' should be in the rawValue capital 'V' instead of small "v". So, it should be rather than rawvalue rawValue.

    Thank you

    Sidonie.

  • Several drop-down lists with Switch statement

    I use multiple drop-down list to help a user find that associate their correct sales based on the model and the part they use. However my "switch" statement will always be the case "default". Where am I evil scripts?

    https://workspaces.Acrobat.com/?d=X2MirIocbNfyojw6QezAbA

    the variable "part' requires a value." Add the script:

    part = this.rawValue

    SOnineThreenine.fxnineThreenine (part);

    to the output of dropDownlist2 event. Otherwise, the variable "share" gives you an error message [object XFAObject] console

  • Problem with button state

    Hello! I want to create a button with text. The State of the button should be the title of the text and the pointed State will be a paragraph with a rectangle in the background and the title disappears.

    I converted the title as button and I leave the paragraph text and draw the rectangle.

    My problem is when my mouse went hover title, nothing happened and when I went to move the paragraph box and rectangle, they seemed.

    Cannot choose the hover box? Can I create additional layers for rectangle and paragraph?

    The first time I try to create this button, he had run, but when I replace a bad shot.

    I'm working on the professional Flash CS6 and I use AS2. For example, I don't use THAT on my button, there is only 1 text converted to (title) button, 1 shape (rectangle) and 1 text (button).

    Fight with a button make me sick, if nursing Flash can cure my illness there will be great

    Good bye

    Tom

    If the invisible things in hover is the cause the invisible substance appears then looks that you have placed such things (text and background) under Hit of the button.  The image clicked sets where the button interaction can occur.   Make sure that you place only stationary flight controls in the frame over and no one else.

  • Problem with CASE statements

    Hi all

    I have a calculation in a report of Discoverer Desktop with 29 instructions BOX and still 2 case statements more to add. The problem is that my report freezes and fails to run due to the excessive number of case statements. I need to put the 31 statemnts cases in the report, how do I do this? Is there another way to do it without causing the report to freeze?

    Below is part of my instructions box just to show you what I'm doing:

    CASE WHEN Ex = 'MM' AND THEN of OTHER NULL result (', ')
    CASES WHERE Ex = "PP" AND result IN (40,35,30,25) THEN NULL OTHERWISE
    CASE WHEN Ex = he's ' AND result IN (' a ',' B', 'C', d ') THEN NULL OTHERWISE
    -CASE WHEN Ex = 'IO' AND THEN of OTHER NULL result ('Distinction', 'Merit')
    -CASE WHEN Ex IN ('ZZ', 'WW', 'SS', 'KK') AND ('PASS', 'P') THEN to ANOTHER NULL result...

    The last statement should be BOX WHEN... THEN NULL OTHERWISE 1 END END END END...

    Help, please. Thank you.

    Hello
    You have reached the limit of characters in a calculation.

    Try to set into a single statement as follows:

    CASE WHEN Ex = 'MM' AND THEN of OTHER NULL result (', ')
    WHEN Ex = "PP" AND as a result (40,35,30,25) THEN NULL OTHERWISE
    WHEN Ex = he's ' AND result IN (' a ',' B', 'C', d ') THEN NULL OTHERWISE
    WHEN Ex = 'IO' AND THEN of OTHER NULL result ('Distinction', 'Merit')
    WHEN Ex IN ('ZZ', 'WW', 'SS', 'KK') AND ('PASS', 'P') THEN to ANOTHER NULL result...

    The last statement should be BOX WHEN... THEN NULL OTHERWISE 1 END

    Another option is to combine all the statements of NULL in a series of gold options like this:

    BOX WHEN
    (Ex = 'MM' AND the result in (', am')) OR
    (Ex = "PP" AND result IN (40,35,30,25)) OR
    (Ex = he's ' AND translated BY (' a ',' B', 'C', ')) OR
    (Ex = 'IO' AND as a result ('Distinction', "according to merit")) OR
    (Ex IN ("ZZ", "WW", "SS", "KK") AND result IN ('PASS', 'P')) THEN ANOTHER NULL...

    Best wishes
    Michael

  • Problem with the States and component in flex

    I am trying to build this flex like this application

    ExpertDiscoverySystem.mxml

    <? XML version = "1.0" encoding = "utf-8"? >
    " < = xmlns:fx s:Application ' http://ns.Adobe.com/MXML/2009 "
    xmlns:s = "library://ns.adobe.com/flex/spark".
    xmlns:MX = "library://ns.adobe.com/flex/mx" minWidth = minHeight = "1280" '960' xmlns:component = 'rate' currentState 'SearchStart' = >
    < s:layout >
    < s:BasicLayout / >
    < / s:layout >
    < s: states >
    < name s: State = "SearchName" / >
    < name s: State = "SearchDomain" / >
    < name s: State = 'SearchResult' / >
    < name s: State = "SearchStart" / >
    < / s: states >
    < fx:Declarations >
    <! - Place non-visual elements (e.g., services, items of value) here - >
    < / fx:Declarations >

    <!-< fx:Script >
    <! [CDATA]
    private void changeState (): void {}
    this.currentState = 'SearchResult ';
    searchpage.searchTerm.text = searchpage.getResult ();
    }
    []] >
    < / fx:Script >->

    "" < XY = '0' mx:Image = '0' source = '... / image/background.jpg "includeIn ="SearchDomain, SearchName, SearchStart"/ >
    <!-< s:TextInput '120,65' = x y = "507.8" width = "806" id = "searchText" includeIn = "SearchDomain, SearchName" / >
    < s:Button "951" = x y = '508' label = "Find it!" id = "Search" includeIn = 'SearchDomain SearchName'-click = "" / >-->
    < mx:LinkButton label = "Name" fontSize = "36" = "Verdana" includeIn = fontFamily click "SearchStart" = "currentState ="SearchName"" color = "#CE1717" enabled = "true" x = "383" y = "556" fontWeight = "bold" / >
    < mx:LinkButton fontSize = fontFamily "36" = "Verdana" click = "currentState ="SearchDomain"" includeIn = "SearchStart" color = "#CC1C1C" label = "Domain" '656' = x y = "555" fontWeight = "bold" / > "
    "< includeIn = 'SearchResult' x = '0' mx:Image = '0' source = '... /image/BackgroundSearch.jpg"/ >
    < s:TextInput = 'SearchResult' x = "542.1" includeIn = "47.6" width = "576" / >
    < s:Button = 'SearchResult' x = "1132" includeIn = '47.1' label = 'Search' id = 'Search2Button' / >
    < includeIn: search for components = "SearchDomain" x = "250" y = "420" >
    < / research components: >
    < component includeIn: searchResult = 'SearchResult' id 'Advanced' = x = "29" y = "115" >
    < / component: searchResult >
    < includeIn: search for components = "SearchName" x = "250" y = "420" >
    < / research components: >

    < / s:Application >

    and the component

    Search.MXML

    <? XML version = "1.0" encoding = "utf-8"? >
    " < = xmlns:fx s:Group ' http://ns.Adobe.com/MXML/2009 "
    xmlns:s = "library://ns.adobe.com/flex/spark".
    xmlns:MX = "library://ns.adobe.com/flex/mx" width = "800" height = "400" contentBackgroundAlpha = '0,0' xmlns:component = 'rate' >
    < s:layout >
    < s:BasicLayout / >
    < / s:layout >

    < fx:Declarations >

    <! - Place non-visual elements (e.g., services, items of value) here - >
    < component id: searchResult = searchedTerm = "{"Advanced"searchTextInput.text}" >
    < / component: searchResult >
    < / fx:Declarations >
    < fx:Script >
    <! [CDATA]
    private void changeState (): void {}
    this.currentState = 'SearchResult ';
    searchpage.searchTerm.text = searchpage.getResult ();
    }
    []] >
    < / fx:Script >

    < s:TextInput width = "572" id = "searchTextInput" x = "49" y = "83" / >

    < s:Button label = 'find it!' id = 'search"click =" changeState () ""652"= x y ="84"/ >"
    < / s:Group >

    and searchResult.mxml

    <? XML version = "1.0" encoding = "utf-8"? >
    " < = xmlns:fx s:Group ' http://ns.Adobe.com/MXML/2009 "
    xmlns:s = "library://ns.adobe.com/flex/spark".
    xmlns:MX = "library://ns.adobe.com/flex/mx" width = "900" height = "800" >
    < fx:Declarations >
    <! - Place non-visual elements (e.g., services, items of value) here - >
    < / fx:Declarations >

    < fx:Script >
    <! [CDATA]
    [Bindable]
    public var searchedTerm:String;
    public var searchCriteria:String;
    public function getResult (): String
    {
    Return searchedTerm;
    }
    []] >
    < / fx:Script >
    < s:Label x = '6' y = '13' text = "" you searched: "fontSize ="18"/ >"
    < s:Label = "173" x = "13" fontSize = "18" id = "searchTerm" color = "#FF0000" / >

    < / s:Group >

    The problems goes like this. I need to access my main of my search.mxml component mxml application state 'SearchResult', with my code view, it is impossible to access at all because the State 'SearchResult' was not include the search.mxml component

    Is there anyway to access the State of my main application of my component?

    Hello

    Try to use FlexGlobals.topLevelApplication.currentState = 'SearchResult '; in your Search.mxml component.

    Thank you

    Jean Claude

  • problem with the States

    Hello

    in my application, I would like something code you see in the code.

    but this is not possible, because now I have two buttons with the id 1.
    What is the best way to solve this problem? especially when you have a lot of buttons? I mean, I need the id when I want to withdraw the child...

    Thank you!

    I think you need to rethink your statements. You try to add the same button in two States, which should not be necessary. You can base a State to another State, more specifically.

    Also, you cannot use numbers as identifiers.

  • Select problem with multiple statements

    I have a stored procedure where I create a table variable and then doing an insert and the problem I have is to separate my select statements that I use to insert into the table variable. I tried wrapping each select statement in parentheses and separating them by a comma; However, it does not either. I also tried aliasing the select statement with the same column name. I will be using the return on this stored procedure for a graph charting.

    Here's a SP and here is the error.


    The selection list for the INSERT statement contains fewer items than the insert list. The number of SELECT values must match the number of columns in the INSERT.

    I try and rewrite in the form a single query using case statements. But the syntax that might work is

    insert into @SomeTable (col1, col2, col3)
    Select (select count (*) of @OtherTable).
    (select count (*) in @OtherTable),
    (select count (*) in @OtherTable)

    (> [TWO_RACES] [int] NULL)

    And it would be tall... everyone. LMAO

  • problem with client_host statement

    Hi all. I'm on devsuite 10g.
    I have a problem when executing client_host.
    With another application, I exported a job as a script (.bat file).
    Now, I want to run this file from my application form.
    With webutil I am able to locate the file on the client computer.
    To run it, I run this command:

    Client_host ("cmd /c start" | my_file_directory\my_file.bat |) '' );

    I encountered an error.
    So I created a .bat file, in which there is this command: calc.exe;
    Once I execute this file using the same statement in client_host, as before, I noticed that he has run from my office and in the back will appear this way:

    C:\Documents and Settings\dellipri\Desktop

    I tried to run my script working file both double click on it and manually open a back box and wrote the full path and name of the file and everything is OK.
    So what I would like to know if there is an option that I put in my statement of client_host in order to run the my_file_name from the path absolute and not from my office.
    Thank you all for collaboration,
    Fabrizio

    now, there's the * / d parameter mentioned above some messages:

    C:\Dokumente und Einstellungen\ChristianE>cmd /c "cd /d f:\test&&test.bat"
    
    F:\test>notepad test.txt
    
    F:\test>pause
    Drücken Sie eine beliebige Taste . . .
    
    C:\Dokumente und Einstellungen\ChristianE>
    

    concerning

Maybe you are looking for