Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default Adding Canvas

    I am playing around with a MYSQL example and have added an additional Canvas
    and call the ID server.

    I have added a button to the update canvas with <mx:Button label="Button"
    id="buttonnew" click="goToserver()"/>

    I get an error stating
    Severity and Description Path Resource Location Creation Time Id
    1180: Call to a possibly undefined method
    goToserver. test1234/src test1234.mxml line 85 1211144884143 579

    the code is as follows:

    <?xml version="1.0" encoding="utf-8"?>
    <!--
    Main application MXML file.
    MXML defines the UI layout of your application as well as the connection of
    UI components
    to your data source (via data binding) and the ActionScript event handlers
    that
    implement your application's UI logic.
    The MXML file that starts with an <mx:Application> tag is the main source
    code file
    for your Flex application.
    -->
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
    pageTitle="employees"
    creationComplete="initApp()" backgroundGradientColors="[#ffffff, #ffffff]"
    width="800" height="600">

    <!--
    Externalized script "include" tag.
    This file contains the UI logic for the CRUD application. All application
    logic
    in Flex is written in ActionScript, the same language used by Flash.
    Although all of this code could have been included directly in the mx:Script
    tag
    within this file, we recommend externalizing it for clarity.
    -->
    <mx:Script source="employeesScript.as" />

    <!--
    The tags below define the application's UI components and their initial
    properties.
    Every tag can be accessed in ActionScript via its "id" property, similar to
    HTML tags
    accessed via JavaScript.
    Note that unlike HTML, Flex does not use a flow-based model. With the
    exception of
    some containers, Flex controls are positioned on the page using their width
    and height
    properties, so the order of the tags in the file does not affect the layout.
    -->
    <mx:ViewStack id="applicationScreens" width="100%" height="100%">
    <mx:Canvas id="view" width="75%" height="100%">

    <!--
    This DataGrid is bound to a data provider, the object "dataArr" which is
    instantiated in the included script file. In general, data providers are
    collections
    such as Array, ArrayCollection, XMLObject, etc. that are declared with the
    [Bindable]
    tag and set as the "dataProvider" property of a UI component. When the
    data in
    a data provider changes, Flex will automatically update any bound UI
    components
    with the new data.
    -->
    <mx:DataGrid id="dataGrid"
    dataProvider="{dataArr}"
    rowCount="8"
    editable="true"
    resizableColumns="true"
    headerRelease="setOrder(event);"
    width="479" x="10" height="239" y="10">
    <mx:columns>
    <mx:DataGridColumn headerText="ID" dataField="IDCol" />
    <mx:DataGridColumn headerText="NameLast" dataField="NameLastCol" />
    <mx:DataGridColumn headerText="NameFirst" dataField="NameFirstCol" />
    <mx:DataGridColumn headerText="Position" dataField="PositionCol" />
    </mx:columns>
    </mx:DataGrid>

    <!--
    These Buttons call ActionScript functions defined in
    employeesScript.as when they are clicked (as defined by the "click"
    event on the tag). In general, UI event handling in Flex is done by
    assigning
    handler functions to the events on the UI component.
    -->
    <mx:Button id="btnAddNew" click="goToUpdate()"
    icon="@Embed('icons/AddRecord.png')" toolTip="Add Record" x="10" bottom="321"/>
    <mx:Button id="btnDelete" click="deleteItem()"
    icon="@Embed('icons/DeleteRecord.png')" toolTip="Delete Record" x="68"
    bottom="321"/>
    <mx:Label text="Search by NameLast" right="566" bottom="322"/>
    <mx:TextInput id="filterTxt" width="238" toolTip="Search by NameLast"
    enter="filterResults()" right="324" bottom="322"/>
    <mx:Button click="filterResults()" id="filterButton"
    icon="@Embed('icons/SearchRecord.png')" toolTip="Search by NameLast"
    right="276" bottom="321"/>

    </mx:Canvas>


    <mx:Canvas id="update" width="325" height="234">
    <mx:Form width="298" height="224" id="employeesForm">
    <mx:FormItem label="ID:" id="ID_form">
    <mx:TextInput id="IDCol" text=""/>
    </mx:FormItem>
    <mx:FormItem label="NameLast:" id="NameLast_form">
    <mx:TextInput id="NameLastCol" text=""/>
    </mx:FormItem>
    <mx:FormItem label="NameFirst:" id="NameFirst_form">
    <mx:TextInput id="NameFirstCol" text=""/>
    </mx:FormItem>
    <mx:FormItem label="Position:" id="Position_form">
    <mx:TextInput id="PositionCol" text=""/>
    </mx:FormItem>
    <mx:Button label="Button" id="buttonnew"
    click="goToserver()"/>
    <mx:Button label="Cancel" id="btnCancel"
    click="goToView()"/>
    <mx:Button label="Save" id="btnSubmit"
    click="insertItem()"/>
    </mx:Form>
    </mx:Canvas>
    <mx:Canvas id="server" width="100%" height="100%">
    </mx:Canvas>

    </mx:ViewStack>
    </mx:Application>


    Do I have to 'declare' the new canvas somehow

    Cheers

    SteveW



    flashste Guest

  2. Similar Questions and Discussions

    1. Canvas Border
      Hi there I have just completed a page in Fireworks and exported as HTML. When i preview the page in Fireworks (F12) it seems to view fine but...
    2. Canvas and Panels
      This code is working but still have one small problem and i would be happy if i get help with that. when i change the tab nav (click on a Canvas) i...
    3. createMenu() on a Canvas
      Hi All, I'm looking for how to create a Menu on a Canvas, but Application. I wrote following codes, as you can see, I'm aiming to create...
    4. rotating the canvas
      Hi I can't find an answer for this - is it possible to flip/rotate the orientation of the whole canvas. Cheers LAtchet
    5. Canvas Equivalents?
      "Bill Schuhle" <bschuhle1@aol.com> wrote in message news:c4d6m8$f5k$1@forums.macromedia.com... I've been issuing the same gripes for years. ...
  3. #2

    Default Re: Adding Canvas

    Not sure what you mean since the source isn't included. But if you do create a
    new Canvas in AS code, you would need to do addChild(my_canvas); to add it to
    the Application or some other container. You can use addChildAtIndex, etc. for
    layering/z-order.

    slaingod Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139