Creating shapes and adding them to canvas

hi all
How can we create shapes in flex..add them into a canvas i found code that used sprite but was unable to add .as it not being a uicomponent?

You need to wrap your sprite in a UIComponent. Accessing rawChildren can be dangerous.
var mySprite:Sprite = new Sprite();
mySprite.graphics.beginFill(0xFFCC00);
mySprite.graphics.drawCircle(30, 30, 30);
var uic:UIComponent = new UIComponent();
uic.addChild(mySprite);
this.addChild(uic);
If this post answers your question or helps, please mark it as such.
Greg Lafrance
www.ChikaraDev.com
Flex Development and Support Services

Similar Messages

  • Creating users and adding them to groups programmatically in Portal 902

    What is the correct process and code needed to create a user and add it to a group programmatically in Portal 9.0.2 and how is it different from what it used to be in 309.
    If anyone has an answer, please let me know and all contributions are really appreciated.
    Thanks

    You can use these procedures.
    procedure Create_User(first_name IN VARCHAR2
    ,last_name IN VARCHAR2
    ,password IN VARCHAR2
    ,email IN VARCHAR2
    ,employeenumber IN VARCHAR2
    ,description IN VARCHAR2
    is
    retval PLS_INTEGER;
    emp_session DBMS_LDAP.session;
    emp_dn VARCHAR2(256);
    emp_rdn VARCHAR2(256);
    emp_array DBMS_LDAP.MOD_ARRAY;
    emp_vals DBMS_LDAP.STRING_COLLECTION ;
    ldap_host VARCHAR2(256);
    ldap_port VARCHAR2(256);
    ldap_user VARCHAR2(256);
    ldap_passwd VARCHAR2(256);
    ldap_base VARCHAR2(256);
    BEGIN
    retval := -1;
    ldap_host := '<you_host>';
    ldap_port := '4032';
    ldap_user := 'cn=orcladmin';
    ldap_passwd:= '<orcladmin_password>';
    ldap_base := 'cn=users,dc=<your_compani_name>,dc=com';
    DBMS_LDAP.USE_EXCEPTION := TRUE;
    emp_session := DBMS_LDAP.init(ldap_host, ldap_port);
    -- Bind to the directory
    retval := DBMS_LDAP.simple_bind_s(emp_session,ldap_user, ldap_passwd);
    emp_array := DBMS_LDAP.create_mod_array(14);
    emp_vals(1) := first_name;
    DBMS_LDAP.populate_mod_array(emp_array,DBMS_LDAP.MOD_ADD,'cn',emp_vals);
    DBMS_LDAP.populate_mod_array(emp_array,DBMS_LDAP.MOD_ADD,'givenname',emp_vals);
    DBMS_LDAP.populate_mod_array(emp_array,DBMS_LDAP.MOD_ADD,'uid',emp_vals);
    emp_vals(1) := last_name;
    DBMS_LDAP.populate_mod_array(emp_array,DBMS_LDAP.MOD_ADD,'sn',emp_vals);
    emp_vals(1) := employeenumber;
    DBMS_LDAP.populate_mod_array(emp_array,DBMS_LDAP.MOD_ADD,'employeenumber',emp_vals);
    emp_vals(1) := description;
    DBMS_LDAP.populate_mod_array(emp_array,DBMS_LDAP.MOD_ADD,'description',emp_vals);
    emp_vals(1) := 'top';
    emp_vals(2) := 'person';
    emp_vals(3) := 'organizationalPerson';
    emp_vals(4) := 'inetOrgPerson';
    emp_vals(5) := 'orcluser';
    emp_vals(6) := 'orcluserv2';
    DBMS_LDAP.populate_mod_array(emp_array,DBMS_LDAP.MOD_ADD,'objectclass',emp_vals);
    emp_vals.DELETE;
    emp_vals(1) := email;
    DBMS_LDAP.populate_mod_array(emp_array,DBMS_LDAP.MOD_ADD,'mail',emp_vals);
    emp_vals(1) := password;
    DBMS_LDAP.populate_mod_array(emp_array,DBMS_LDAP.MOD_ADD,'userPassword',emp_vals);
    emp_dn := 'cn=' || first_name || ',' || ldap_base ;
    retval := DBMS_LDAP.add_s(emp_session,emp_dn,emp_array);
    DBMS_LDAP.free_mod_array(emp_array);
    retval := DBMS_LDAP.unbind_s(emp_session);
    -- Handle Exceptions
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE(' Error code : ' || TO_CHAR(SQLCODE));
    DBMS_OUTPUT.PUT_LINE(' Error Message : ' || SQLERRM);
    DBMS_OUTPUT.PUT_LINE(' Exception encountered .. exiting');
    end Create_User;
    create or replace
    procedure Add_User_To_Group(user_name IN VARCHAR2
    ,group_name IN VARCHAR2
    is
    retval PLS_INTEGER;
    ldap_host VARCHAR2(256);
    ldap_port VARCHAR2(256);
    ldap_user VARCHAR2(256);
    ldap_passwd VARCHAR2(256);
    ldap_base VARCHAR2(256);
    my_session DBMS_LDAP.session;
    my_message DBMS_LDAP.message;
    my_entry DBMS_LDAP.message;
    my_array DBMS_LDAP.MOD_ARRAY;
    my_vals DBMS_LDAP.STRING_COLLECTION ;
    group_dn VARCHAR2(256);
    user_dn VARCHAR2(256);
    BEGIN
    retval := -1;
    ldap_host := '<you_host>';
    ldap_port := '4032';
    ldap_user := 'cn=orcladmin';
    ldap_passwd:= '<orcladmin_password>';
    ldap_base := 'cn=users,dc=<your_compani_name>,dc=com';
    DBMS_LDAP.USE_EXCEPTION := TRUE;
    my_session := DBMS_LDAP.init(ldap_host, ldap_port);
    -- Bind to the directory
    retval := DBMS_LDAP.simple_bind_s(my_session,ldap_user, ldap_passwd);
    --Find the user
    my_vals(1) := '1.1';
    retval := DBMS_LDAP.search_s(my_session,
    ldap_base,
    DBMS_LDAP.SCOPE_SUBTREE,
    '(&(objectClass=person)(cn=' || user_name || '))',
    my_vals,
    0,
    my_message);
    my_entry := DBMS_LDAP.first_entry(my_session, my_message);
    IF my_entry IS NOT NULL THEN
    user_dn := DBMS_LDAP.get_dn(my_session, my_entry);
    retval := DBMS_LDAP.search_s(my_session,
    ldap_base,
    DBMS_LDAP.SCOPE_SUBTREE,
    '(&(objectClass=orclGroup)(cn=' || group_name ||'))',
    my_vals,
    0,
    my_message);
    my_entry := DBMS_LDAP.first_entry(my_session, my_message);
    IF my_entry IS NOT NULL THEN
    group_dn := DBMS_LDAP.get_dn(my_session, my_entry);
    my_array := DBMS_LDAP.create_mod_array(1);
    my_vals(1) := user_dn;
    DBMS_LDAP.populate_mod_array(my_array, DBMS_LDAP.MOD_ADD, 'uniqueMember', my_vals);
    retval := DBMS_LDAP.modify_s(my_session, group_dn, my_array);
    DBMS_OUTPUT.PUT_LINE(RPAD('modify_s Returns ',25,' ') || ': '|| TO_CHAR(retval));
    DBMS_LDAP.free_mod_array(my_array);
    END IF;
    END IF;
    my_vals.DELETE;
    retval := DBMS_LDAP.unbind_s(my_session);
    -- Handle Exceptions
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE(' Error code : ' || TO_CHAR(SQLCODE));
    DBMS_OUTPUT.PUT_LINE(' Error Message : ' || SQLERRM);
    DBMS_OUTPUT.PUT_LINE(' Exception encountered .. exiting');
    end Add_User_To_Group;

  • Live paint vs. just selecting shapes and filling them

    I traced an image in cs5 and am not quite sure what the benefit of using live paint to fill shapes with color with the live paint bucket over selecting the shapes and filling them the traditional way. Besides being able to fill shapes with gaps, what is the benefit of live paint?

    function(){return A.apply(null,[this].concat($A(arguments)))}
    not quite sure what the benefit of using live paint
    The benefit of a "flood fill" tool in a vector program is that it can be used to create filled paths corresponding to shapes which only appear to be defined, but are not actually otherwise fillable paths.
    For example: Get the Line Tool. Draw four paths in the form of a tic-tac-toe diagram. Now suppose you want to fill that middle "square" with a color.
    But there is no actual square to which you can apply a fill. There exists only four open paths. The "square" is just the visual bounds of the intersections of the four open paths. A flood fill tool creates the necessary path and applies a fill to it.
    Illustrator's specific flood-fill tool is the so-called Live Paint feature. It's called "live" because it is implemented as a "live effect." That is, the paths it creates automatically are not "nailed down" until the effect is "expanded." That is, the effect gets automatically re-run and re-drawn each time you modify the path(s) to which it is applied. That's why the program has to mark the set of associated paths as a special kind of object that exists just for the benefit of the feature: A "Live Paint Group."
    JET

  • I have a windows computer. How can I create apps and put them on itunes?

    I have a windows computer. How can I create apps and put them on itunes?

    You can't. The iOS SDK requires Mac OS X and an Intel Mac; Windows applications can't be put on either the iOS or Mac OS X App Stores.
    (82889)

  • How do I create variables and store them?

    How do I create variables and store them?

    As someone already said, we need to know a little more about what you want to do with these variables, but in general, APEX Items are probably what you want. You can create APEX Items at the Application or Page level. Once you set the value of an item, you can reference it anywhere else in the application. So, if you have an item on page 1 called P1_ENAME, you can reference it on page 32 using bind variable syntax :P1_ENAME. If you just want to store but not display some information, you can use either a hidden page item or an Application Level item. Take a look at the 2 Day Developers Guide for more info.
    Tyler

  • Iterate shapes and convert them to Compound Shapes

    In order to keep shapes as shape layers in Photoshop when exporting from .ai to .psd, one has to convert all shapes to Compound Shapes.
    At the moment, i'm using an action that converts the shape, then selects the shape above. Starting with the bottom shape, i have to click
    the action for every shape.
    Is there a way to make a script cycle through all shapes and groups, converting them to Compound Shapes?
    At the end of the script, it would be nice to have it make an export of the file to .psd aswell.
    I'm somewhat familiar to javascript, but i would really appreciate some guidelines in creating this.

    It okay is, because this will be great learning for our minds!  There is a way, to have your Extendscript execute the AHK script which tells it to "send" the F-keys as if it came from your keyboard.  The action will go, but I am not very clear on how out of synch the action will be with the script.  At first thought , putting $.sleep() may do the trick, especially if your action does not take long & there's not a big chance of it having to take long.  Well, anywho, after the time break, it will go do its script thing, which is select the next shape or group (pageItem).  And at the end, hey, you can try tacking on the PSD saving using the export with ExportOptionsPhotoshop- but that's later!  Qwertyfly... has some examples here of executing an AHK script from the jsx script, check 'em out!

  • OIM11gR2 - API - how to create accounts and link them to an oim user

    hi,
    my problem is the following:  I would like to import a lot(1000+) of different service accounts to my oim system and link them to oim users.
    at the moment, the information which service-account belongs to which person is stored in a textfile.
    I use this API code to create accounts:
    ProvisioningService service=getClient().getService(ProvisioningService.class);
    ApplicationInstanceService service=getClient().getService(ApplicationInstanceService.class);
    ApplicationInstance appInstance=service.findApplicationInstanceByName("LinuxServer001");
    FormInfo formInfo=appInstance.getAccountForm();
    String formKey=String.valueOf(formInfo.getFormKey());
    AccountData accountData=new AccountData(formKey,null,null);
    Account account=new Account(appInstance,accountData);
    account.setAccountType(Account.ACCOUNT_TYPE.Primary);       
    service.provision(userKey, account);
    this works fine! the account is displayed in the section  "user accounts", but the status of the created account is "Provisioning".
    when I reconcile this linux server, oim doesn't establish a link between the service account on the target system and the created account! why?
    how can i solve my problem? which information is missing, to establish a link between an existing account on a target system and an api created account?
    thank you!
    br,
    max

    Thanks, Brian, for your support! - It's working.
    It's hard to understand why NI did not pass this parameter to the top of the call chain...
    I also needed some time to understand the syntax of the string passed to the subaddress node:
    The name of the worksheet needs to be framed by single quotation marks and the following cell address must preceeded by an exclamation point (!).
    A working link pointing to cell "A1" of "Worksheet 1" looks like:
    'Worksheet 1'!A1
    Maybe also of interest: If you want to point the link to a worksheet inside the document itself, the parameter "address" (URL of link - href) can be left empty.
    Thanks and Regards,
    Ingo

  • Create users and assigning them security on the Entity dimension

    Hi All,
    I’m working with Hyperion ESSBASE 11.1.1.3 and Hyperion Planning 11.1.1.3 and I have a problem related to create new users (without admin permissions) and assigning them security on the Entity dimension.
    When I access with these users to a Dataform in Planning appears these message:
    “Security and/or filtering has resulted in a required dimension not being represented on this data form”
    I have followed these steps:
    - I have created new users (Native Directory) and provision them against essbase and the planning application in Shared Services.
    - I have expanded the essbase server > security > refresh security from shared services > all users.
    - I have assigned security roles in all members of Entity dimension in Planning.
    - I have refreshed database and security filters in Planning.
    Please help
    Thanks a lot in advance

    Hi,
    You will have to apply security to all the standard dimensions and not just entity, so that will be account, entity, scenario and version.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Create shape and motion tween of a line

    I am trying to create a line graph in which the line is
    following a certain path over time like in a simulation. The line
    starts with a point in frame 1 and ends with a smooth not straight
    line in e.g. frame 50. The line has to "run" like in an
    electrocardiogram.
    Is it possible to create this in flash?
    If so, how? I tried to combine shape and motion tweening, but
    that didn't work.
    Thanks for your help

    This is doable
    If it is a fixed set of lines you would create the lines in a
    MovieClip symbol and then slide the MovieClip symbol under a mask
    by changing the _x property with either onEnterFrame or
    setInterval.
    If you have to draw the lines from dynamic data at run time,
    you use the
    MovieClip.lineStyle
    and the
    MovieClip.lineTo
    properties on a MovieClip that you then would scroll under a mask
    if you are looking for the electrocardiogram rolling paper effect.

  • After Effects Help | Creating shapes and masks

    This question was posted in response to the following article: http://helpx.adobe.com/after-effects/using/creating-shapes-masks.html

    Hi Todd,
    I don't think either approach accomplishes what I am trying to do. Just as when using a shape tool on an existing layer to create a mask, none of these approaches lets me alter a shape path after creating it, in terms of number of points, inner/outer radius and inner/outer roundness. Nor can I animate those characteristics.
    The Help file creates the impression that you can copy/paste a Shape path from a Shape layer. If that were true, I could create a shape, copy/paste that path to a mask path, keyframe it, go back to the original shape layer, change its propertie and copy/paste that new shape path to the mask path at a different time, thus morphing from one shape to another. I don't see any way to do that.
    Jeff

  • Taking songs from ipod and adding them to the i tunes library

    Can you take songs from an ipod and add them to the i tunes library? if so give me a point in the right direction!
    Thanks

    There is a manual method of accessing the iPod's hard drive on Windows posted in this thread: MacMuse - iPod to iTunes
    There are also a number of third party utilities that you can use to retrieve the files from your iPod, this is just a selection. Have a look at the web pages and documentation for these, they are generally quite straightforward.
    iPod Access Mac and Windows Versions
    YamiPod Mac and Windows Versions
    PodUtil Mac and Windows Versions
    iPodCopy Mac and Windows Versions
    PodPlayer Windows Only
    PodPlus Windows Only

  • Creating podcast and adding to iTunes

    I imported 3 lectures into garageband and put them together as a podcast.  I then wanted to put it into ITunes so I could sync to my Ipod and listen during free time.  However I cant find in my library.  Also when I try to drag it into Itunes, the whole library list goes blue.  Can anybody offer some help.  Thanks.

    You can't import it as a podcast unless it's actually online and you subscribe to the feed. Just place the individual episode media files in the 'Music' section of iTunes. You can give them a specific genre so that you can group them together.

  • Need help creating custom objects and adding them to an array.

    Hi Everyone,
    So I'm dinking around in Powershell today and I'm failing at creating an array of custom objects.  I want to create a HTML report that builds out after every MDT image update. To do that, I need to collect my data on what's contained in each build.
    Here's my current script in progress -
    function Parse-Dependents($fullname){
    #PARAMETER SWITCHING
    if(!($fullname)){
    $dependents = get-dependents
    if($fullname){
    $dependents = get-dependents -fullname $fullname
    #SPIN THROUGH ARRAY OF GUIDS FROM GET-DEPENDENTS
    foreach($d in $dependents){
    #SPIN THROUGH EACH APP IN APPLICATIONS.XML
    foreach ($app in $apps){
    #IF MATCH THEN ADD OBJECT WITH PROPERTIES
    if($d -match $app.guid){
    #ADD APPLICATION MATCH TO THE ARRAY
    $applications = @{
    'Name' = $app.ShortName;
    'GUID' = $app.Guid;
    'Version' = $app.Version;
    'Last Modified Time' = $app.LastModifiedTime;
    'Last Modified By' = $app.LastModifiedBy;
    'Install Directory' = [string]'\\my\path\to\MDT\' + $app.WorkingDirectory.TrimStart(".","\")
    'CommandLine' = $app.CommandLine;
    new-object -typename PSObject -property $applications
    #RETURN MATCHED ARRAY
    return $applications
    It all works great until I look at my output and see that I get my expected properties and array, but at the end it's created additional empty entries for each of my initial properties I assigned.  So I get my list of apps like this :
    powershell.ex... OrgChart Plugin  \\my\mdt\server\ XX\user                     9/22/2014 5:... {ffee7497-0c...
    And then below it :
                     CommandLine                                                                                    
                     Name                                                                                           
                     Install Direc...                                                                               
                     Last Modified By                                                                               
                     Version                                                                                        
                     Last Modified...                                                                               
                     GUID                                                                                           
    And these are all listed under the Name property.  I'm still pretty new to PS (8 months or so now), and rarely have to create a custom object, but this seems like a case for doing so to create a custom html report.  Any ideas would be greatly appreciated.
    Ryan

    It's not really all that strange.  
    If you look at your script, you're not outputting the hash table until both loops finish.  The values are dependent on the properties of the $app objects enumerated in the inner loop, and only outputting an object if the dependent ($d) matches the $app
    guid property.
    At the end, you're outputting the hash table without that test, so it's going to have values based on the last $app in the loop, regardless of whether the guid matches the dependents or not.
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

  • I created buttons and added a digital signature, when I saved and reopened my buttons disappeared?

    I created a multi page PDF with numerous buttons for navigation. I realized I had forgotten to sign one of the individual pages, (I had recently added) so I simply put in a digital signature. I saved the document and reopened it later to find it made all the buttons non functional and uneditable... Some of the buttons were transparent (placed over written dates for reference) and some were colored boxes with text. The colored buttons became "flattened" and I could no longer edit them or click on anything.
    Why did this happen? Is the digital signature to blame? Is there a way to edit the existing buttons or do I need to recreate all of them along with the actions associated with each? any assistance would be much appreciated!

    It's possible to set up a signature field to lock other fields when it is signed. Could that be what happened? It also possible to choose to lock the file when signed to prevent changes. It's hard to tell what happened without seeing the file.

  • Proportioning shapes and aligning them (specifically hexagons)

    Hello, I am having a really hard time figuring this out, so I figure I'd come here. I am trying to create a striped outline around a design and I can't seem to do it. I'm doing the white stripes (which is what I'm troubled with) in the shape of a hexagon around the hexagon design in the middle. I can't resize each hexagon so that when i align them vertically and horizontally there is the same space between all of them. any help is appreciated. thanks
    here is a picture of what i'm working on...

    amnv,
    To add new strokes, in the Appearance palette flyout (top right arrow) tick Add New Stroke, then make sure you have it selected in the main Appearance palette when you change it.
    For stroke/nofill hexagonal paths, you can also use Object>Path>Offset Path setting the Offset to equal the sum of the (new) Stroke Weight and the desired gap. For identical Stroke weights and gaps you can just repeat it.
    However, it seems that your hexagon shapes are fill/nostroke compound paths forming rings of increasing size, and none of the suggested ways would work with that.
    It is much easier to work with stroke/nofill paths, unless you wish to have scaled shapes, with increasing gaps and thicknesses.
    You can scale either; for stroke/no fill paths you need to tick Scale Strokes & Effects, which you can do in the Transform palette flyout.
    If you wish to have hexagons of different widths but with identical gaps, as keenly spotted by Emil, for a stroke/nofill version you may also:
    1) Create the innermost hexagon,
    2) Scale a copy to get the outermost hexagon and adjust its Stroke Weight if needed,
    3) Object>Blend>Options, set the number of intermediate hexagons,
    4) Select both and Object>Blend>Make, you may need to go back and adjust the size of 2),
    5) Object>Blend>Expand,
    6) Align>Distribute Spacing.

Maybe you are looking for