Creating generic actions for multiple objects

Hello world

It's something I have interviewed on during some time and am finally get around to him asking.

I want to simplify the coding and I was wondering if there was a way to write a script that could be used on multiple objects without having to write it to treat each object individually.

I build a simple menu, where I want the menu link to increase and intensify when the button because it is reversed and then return to its original position when the mouse leaves. I know I can write this by button and point, but wanted to see if there was a way to write once and then apply the action to all.

E.G.

My menu is composed of 5 elements (and the respective buttons) home_mc (home_btn), menu_mc, dining_mc, contact_mc, specials_mc.

If I write the code

home_btn.addEventListener (MouseEvent.MOUSE_OVER, homeOver);

home_btn.addEventListener (MouseEvent.MOUSE_OUT, homeOff);


function homeOver (MouseEvent) {}

TweenLite.to (home_mc,.25, {alpha: 1, scaleX:1.25, scaleY: 1.25, x: 150,8, y:273}); })

}

function homeOff (MouseEvent) {}

TweenLite.to (home_mc,.25, {alpha:. 75, scaleX:1, scaleY: 1, x: 157, y:280}); })

}

This will only apply to the home button. I want to be able to use this effect for each button in the menu, however.

I know that's not the Tweener class, so may not be as well supported here, but I can go to one if necessary.

Can I write this while several objects may be affected by the same code?

home_btn.addEventListener (MouseEvent.MOUSE_OVER, homeOver);

home_btn.addEventListener (MouseEvent.MOUSE_OUT, homeOff);


rOver (MouseEvent) {} function

TweenLite.to (GENERIC OBJECT,. 25, {alpha: 1, scaleX:1.25, scaleY: 1.25,RELATIVE VALUEx:, y:RELATIVE VALUE});

}

function rOff (MouseEvent) {}

TweenLite.to (GENERIC OBJECT,. 25, {alpha:. 75, scaleX:1, scaleY: 1, x:VALUE RELATIVE, y:RELATIVE VALUE});

}


function homeOver (MouseEvent) {}

????

}

function homeOff (MouseEvent) {}

????

}

This could be pie in the sky, but I don't know if I'm not.

Why not just add the invisible area of these attachments menu? You can always have a single invisible clip - and place instances of it in each button... No real reason to keep them separate is there?

If you must keep them separate so that you could use a convention assignment of names - like invis0, invis1, etc. and menu0, menu1, etc.. Then you might do something like:

invis0.addEventListener (MouseEvent.MOUSE_OVER, expandItem);

invis1.addEventListener (MouseEvent.MOUSE_OVER, expandItem);

function expandItem(e:MouseEvent):void

{

var invis: String = e.currentTarget.name.substr (5.1); to get the index

var menuClip:MovieClip is this ['menu' + invis].;

TweenLite.to (menuClip, 1, {scaleX:1.25, scaleY: 1.25});

}

Tags: Adobe Animate

Similar Questions

  • Create the trigger for multiple users

    I am trying to create a trigger for a DDL event which gives an error for 2 users when they try to create a database object or a table.

    Here is my code. When ran it gives me the following error: "WARNING: trigger created with errors of complication."

    Any idea would be appreciated.

    Thank you!

    CREATE OR REPLACE TRIGGER trigger_before_create_object
    BEFORE YOU CREATE ON THE DATABASE

    BEGIN

    IF USER = USER OR "VPD_CLERK1" = "DBSEC_CLERK."
    THEN
    RAISE_APPLICATION_ERROR (' you do not have the privilege to create tables or other database objects.) Contact your administrator if you need the privilege. ") ;
    END IF;
    END;

    Published by: mkmety on April 20, 2013 12:10

    Welcome to the forum!

    Whenever you post provide your Oracle version 4-digit
    >
    I am trying to create a trigger for a DDL event which gives an error for 2 users when they try to create a database object or a table.

    Here is my code. When ran it gives me the following error: "WARNING: trigger created with errors of complication."

    Any idea would be appreciated.

    Thank you!
    >
    And to alert you to the need to view the errors you got. If you did you will see this:
    >
    PLS-00306: wrong number or types of arguments in the call to "RAISE_APPLICATION_ERROR.
    >
    Oracle cannot raise your exception if you:

    1. do not define an exception to throw
    2. don't tell Oracle how exception to throw

    See the section "Defining your own Error Messages (procedure RAISE_APPLICATION_ERROR)" in the doc of the PL/SQL language
    http://docs.Oracle.com/CD/B28359_01/AppDev.111/b28370/errors.htm#i1871

    This article has examples that show how to raise your exceptions.

  • Create following files for multiple instances of ColdFusion Cluster instance?

    So when we created our instance of coldfusion 9 on solaris all files and settings of the primary instance are copied except the following file. This means that any changes made here are used for all ColdFusion instances on this node.  Now I want to play with the settings of the memory for an adjustment of the performance of the applications and I want to do on a single instance. I want to know the process of creating individual files for each instance.

    Thank you

    Pradeep

    Hello Pradeep,

    Thank you for your message. Please see http://helpx.adobe.com/legacy/kb/jrun-4-0-configuring-individual.html for configuring individual JVM settings for each JRun server

    Kind regards

    Anit Kumar

  • Need help creating tip Action for Navigation "Inside-the-same-slide" to let the user Play slide again

    I use 8 Captivate. It is a scenario of HTML5.

    I have need of a button which will allow the user to "replay" the slide. I don't want the button to take the user to the front, back, or do anything else. I want the button to start the slide at the beginning and play without interruption until the end.

    I am looking for help on how to do this using variables and advanced for HTML5 actions or, Alternatively, recommendations on the good tutorials for advanced actions. I prefer the tutorials that will allow me to start at the bottom. I was not able to find tutorials advanced action that assume no prior experience.

    I know that each new user must say this, and I'm afraid that's true for me too. If I can't create a HTML5 work quickly replay button, it will get me in trouble with the client.

    Try this:

    cpCmndGotoSlide is a system variable, which the index starts at 0. The variable cpInfoCurrentSlide system includes an index starting at 1. The reason for the subtraction in this Expression. You need to add continue because a tip action will not release the read head.

    Why choose Standard Simple action? -Captivate Blog

  • Impossible to create an action for windows tiles

    As I have done with so many other actions before, I use the menu Insert. But when I choose window > arrange > tile, it does not have to this article. I tried typing "tile" in the Insert Menu Item dialog box and clicking on search, but which translates into effect > Texture > mosaic tiles. That is not the question I want to

    Why can't I choose window > arrange > tile? Or is there a workaround?

    CS5 Mac OS 10.6.8

    which is all wanted in your action? a single command?

    have you tried to assign a shortcut key for the command of tiling? also works under windows

  • For each object, create a new layer and rename it

    Hello!

    I want to export an Illustrator file to DWG, and I have many things I want to keep the name. But to keep this info in AutoCAD, I need to transfer them as layer names (DWG/DXF export does not record the name of the object, but the name of the first level layer) and put all these layers as layers of level first (DWG/DXF export maintains just first layers of level).

    So I would like to make or find a capable script something like this:

    in my file,.

    for each object,.

    see if there is a layer with the name of the object

    If there is any layer with the same name

    then

    Create a layer,

    give the name of the object to the layer

    endif

    Place the object in this layer

    Is there someone who can help me?

    Thank you!

    You can select your layer, then use "Release to layers", which will create a sublayer for each object that you have, and then a script can rename these layers based on the named object it contains... so you can drag them all out of their layer sublayers parent so that they become the main layers... everything that is explained here, including the script

    Selected lap HAVE sublayers in top-level layers?

  • Change the attributes to multiple objects in the overview

    Hello!

    I'm sure that the answer to that is pretty simple, but I can't get the effect so I post here on this subject.

    I want to configure an object (such as a logo) where, when you go over it, change attributes for multiple objects.

    For example, if I have a white box, with three different lines of text inside it, when you hover, I want the box to become black, one of which becomes green to become blue text and a line turn red.

    But when I put this up, the text color changes when I hover over each line of text (they are in different text boxes) not when I fly over the area as they are.

    the only way I found to do this is by using the status button widget, but I don't want to have to use to do anything where multiple objects must change state.

    Thanks in advance

    -Connor

    Hey Connor,

    You can use a widget of composition to achieve this effect.

    Keep the trigger and transparent target filling and place of relaxation on the top of your Logo.

    Now you can put the modified content (as you want on turnover) in the target container and place it exactly on top of your original content.

    Please refer to the video (see the widget part) who could help: Adobe Muse: Customize Widgets - YouTube

    Let us know if it helped or not.

    Kind regards

    Akshay

  • Create to-dos for the components of the interface of the designer

    Hello

    I am very new to Flex, but I have some experience in programming Java (with the old AWT), Visual Basic 6 and Visual c#.
    The first thing I noticed is that apparently it is not an easy way to create an action for a component in the design view.
    Must be nice, for example, right-click on a button in the view of the designer, and have the option to add an "event listener' or create in code to the onclick action.
    Maybe I need to spend more time on the manual and this feature is already there, but if not, I think that should be a good idea to introduce it.
    Kind regards
    Marco.

    Marco-
    Feel free to connect to a development application bug: http://bugs.adobe.com/jira/

    Thank you-
    Mac

  • CS5 - data merge - create merged Document - record Multiple - ignore the title / other objects on the page?

    When I create a document merged with multiple records, items are usually right, but the problem is the title or header of the page is usually also replicated in each line.

    Anyway is to separate certain objects/images/text/etc so that when I create the merged document (multiple records), he would not repeated those elements?

    This tutorial can make:

    http://TV.Adobe.com/watch/instant-InDesign/automating-a-catalog-with-data-merge/

    But does not explain how he keeps the title, separation points, etc., to reproduce with the fusion of data.

    Thanks for any input

    You have the objects you don't want a copy of the master page?

  • Create an Action in Photoshop CC for a scalable watermark

    I need to create an action in Photoshop CC, with a text layer, making it a scalable watermark. I did the action, but I can't scale of images of different size. In large images it shows very tiny and unreadable. in the images of small dimensions, it is huge and cropped at the edges.

  • I'm looking for a javascriptor for photoshop. I need to create conditional actions according to the decimal ratio.  Thank you

    I'm looking for a javascriptor for photoshop. I need to create conditional actions according to the decimal ratio.  Thank you

    You can find us an if-else for this statement. You can put the reports what ever you want:

    #target photoshop
    var doc = activeDocument;
    var ratio = parseFloat(doc.width/doc.height);
    if(ratio<.25){//enter code here to run action
         }
    if else(ratio<.5){//next code
         }
    if else(ratio <1){more code}
    else{more code}
    
  • Can I create an action that includes a shortcut for the patch tool?

    I am trying to create an action that includes a shortcut for the tool room.  I changed the patch (now R) tool shortcut to be different from the correct place (J), it works fine on the keyboard, but it will not record in action. Is there a way to include this point in the action?

    Something do not have in stock, and there is no menu item for the function you want to save.  The easiest way around your problem is to create a tool preset for the tool part then record by selecting this predefined in your action patch toll to pass to the tool room.

  • Creating a new workspace of object for a custom object

    Hello

    I have a problem with creating workspace object for my custom in the plugin object. I am trying to create something similar to 'chassis-rack' example that comes with the SDK. I added a new category of app and I want to display lists of the inventory of the various objects custom under him. For each custom object, I can see it has objects and its own properties. So I did everything as in the sample "chassis-rack". I am able to display lists of custom my objects. However, when I click on a specific object in the list, its workspace does not appear (although it is defined in plugin.xml), I get a blank screen with a message: "you don't have privileges to view this object, or there is not." I added two custom objects, and both behave the same way.

    I checked the newspaper and there is nothing interesting. I also have it debugged and discovered that "getData" function of the object DataAdapter recorded for these objects is not called when I click on the object in question, so I guess that the problem is linked to the workspace object, but I can not find or understand how I can find it.

    I'll be very grateful for the help.

    Here's my plugin.xml:

    <? XML version = "1.0" encoding = "UTF-8"? >

    < id = "com.emc.ecs.scaleioPlugin plugin"

    moduleUri = "Scaleiopluginui.swf" defaultBundle = "ScaleiopluginuiResources" > "

    < resources >

    < local resources = "en_US" >

    <! - relative path of the .swf resource generated by the build script - >

    < uri="locales/scaleio-plugin-ui-resources-en_US.swf"/ module >

    < / resource >

    < / resource >

    <!--==========================================================================

    ================================== General ===================================

    ==============================================================================-->

    <!-add "ScaleIO ECS' node in the view of the Virtual Infrastructure of the object

    Navigator. This category node is used below for the MDM group collection. ->

    < id = "com.emc.ecs.scaleioAppCategory extension" >

    < extendedPoint > vise.navigator.nodespecs < / extendedPoint >

    < object >

    < title > #{scaleioAppCategory} < /title >

    < parentUid > vsphere.core.navigator.virtualInfrastructure < / parentUid >

    < / object >

    < / extension >

    <!--==========================================================================

    ==================================== MDM =====================================

    ==============================================================================-->

    < id = "com.emc.ecs.mdm.objectType extension" >

    < extendedPoint > vsphere.core.objectTypes < / extendedPoint >

    < object >

    < types >

    < string > ecs:Mdm < / String >

    < / types >

    < label > #{mdmLabel} < / label >

    < labelPlural > #{mdmLabelPlural} < / labelPlural >

    icon <>#{mdmIcon} < / icon >

    < / object >

    < / extension >

    < templateInstance id = "com.emc.ecs.mdm.viewTemplateInstance" >

    < templateId > vsphere.core.inventory.objectViewTemplate < / templateId >

    < variable name = "namespace" value="com.emc.ecs.mdm"/ >

    < variable name = "objectType" value = "ecs:Mdm" / >

    < / templateInstance >

    < templateInstance id = "com.emc.ecs.lists.allMdm" >

    < templateId > vsphere.core.inventorylist.objectCollectionTemplate < / templateId >

    < variable name = "namespace" value="com.emc.ecs.mdmCollection"/ >

    < variable name = "title" value = "#{mdmLabel}" / >

    < variable name = "icon" value = "#{mdmIcon}" / >

    < variable name = "objectType" value = "ecs:Mdm" / >

    < variable name = value="com.emc.ecs.mdm.list"/ "listViewId" >

    < variable name = value="com.emc.ecs.scaleioAppCategory"/ "parentUid" >

    < / templateInstance >

    < id = "com.emc.ecs.mdm.list.sampleColumns extension" >

    < extendedPoint > com.emc.ecs.mdm.list.columns < / extendedPoint >

    < object >

    elements <>

    < com.vmware.ui.lists.ColumnContainer >

    com.EMC.ECS.MDM.column.IP < uid > < / uid >

    < dataInfo >

    < com.vmware.ui.lists.ColumnDataSourceInfo >

    < requestedProperties >

    < string > ip < / String >

    < / requestedProperties >

    intellectual property < sortProperty > < / sortProperty >

    < exportProperty > ip < / exportProperty >

    < /com.vmware.ui.lists.ColumnDataSourceInfo >

    < / dataInfo >

    < item >

    < mx.controls.advancedDataGridClasses.AdvancedDataGridColumn >

    Ip address < headerText > < / headerText >

    intellectual property < dataField > < / dataField >

    < /mx.controls.advancedDataGridClasses.AdvancedDataGridColumn >

    < / component >

    < /com.vmware.ui.lists.ColumnContainer >

    < com.vmware.ui.lists.ColumnContainer >

    com.EMC.ECS.MDM.column.Type < uid > < / uid >

    < dataInfo >

    < com.vmware.ui.lists.ColumnDataSourceInfo >

    < requestedProperties >

    Type < string > < / String >

    < / requestedProperties >

    Type < exportProperty > < / exportProperty >

    < /com.vmware.ui.lists.ColumnDataSourceInfo >

    < / dataInfo >

    < item >

    < mx.controls.advancedDataGridClasses.AdvancedDataGridColumn >

    < headerText > MDM Type < / headerText >

    Type < dataField > < / dataField >

    < /mx.controls.advancedDataGridClasses.AdvancedDataGridColumn >

    < / component >

    < /com.vmware.ui.lists.ColumnContainer >

    < / object >

    < / object >

    < / extension >

    <!--==========================================================================

    ================================ MDM Cluster =================================

    ==============================================================================-->

    < templateInstance id = "com.emc.ecs.mdmCluster.viewTemplate" >

    < templateId > vsphere.core.inventory.objectViewTemplate < / templateId >

    < variable name = "namespace" value="com.emc.ecs.mdmCluster"/ >

    < variable name = "objectType" value = "ecs:MdmCluster" / >

    < / templateInstance >

    < templateInstance id = "com.emc.ecs.lists.allMdmCluster" >

    < templateId > vsphere.core.inventorylist.objectCollectionTemplate < / templateId >

    < variable name = "namespace" value="com.emc.ecs.mdmClusterCollection"/ >

    < variable name = "title" value = "#{mdmClusterLabel}" / >

    < variable name = "icon" value = "#{mdmClusterIcon}" / >

    < variable name = "objectType" value = "ecs:MdmCluster" / >

    < variable name = value="com.emc.ecs.mdmCluster.list"/ "listViewId" >

    < variable name = value="com.emc.ecs.scaleioAppCategory"/ "parentUid" >

    < / templateInstance >

    < id = "com.emc.ecs.mdmCluster.list.sampleColumns extension" >

    < extendedPoint > com.emc.ecs.mdmCluster.list.columns < / extendedPoint >

    < object >

    elements <>

    < com.vmware.ui.lists.ColumnContainer >

    com.emc.ecs.mdmCluster.column.name < uid > < / uid >

    < dataInfo >

    < com.vmware.ui.lists.ColumnDataSourceInfo >

    < requestedProperties >

    < string > name < / String >

    < / requestedProperties >

    < sortProperty > name < / sortProperty >

    name of < exportProperty > < / exportProperty >

    < /com.vmware.ui.lists.ColumnDataSourceInfo >

    < / dataInfo >

    < item >

    < mx.controls.advancedDataGridClasses.AdvancedDataGridColumn >

    < headerText > name < / headerText >

    < dataField > name < / dataField >

    < /mx.controls.advancedDataGridClasses.AdvancedDataGridColumn >

    < / component >

    < /com.vmware.ui.lists.ColumnContainer >

    < com.vmware.ui.lists.ColumnContainer >

    com.emc.ecs.mdmCluster.column.mode < uid > < / uid >

    < dataInfo >

    < com.vmware.ui.lists.ColumnDataSourceInfo >

    < requestedProperties >

    mode of < string > < / String >

    < / requestedProperties >

    mode of < exportProperty > < / exportProperty >

    < /com.vmware.ui.lists.ColumnDataSourceInfo >

    < / dataInfo >

    < item >

    < mx.controls.advancedDataGridClasses.AdvancedDataGridColumn >

    < headerText > Mode < / headerText >

    mode of < dataField > < / dataField >

    < /mx.controls.advancedDataGridClasses.AdvancedDataGridColumn >

    < / component >

    < /com.vmware.ui.lists.ColumnContainer >

    < / object >

    < / object >

    < / extension >

    < id = "com.emc.ecs.mdmCluster.objectType extension" >

    < extendedPoint > vsphere.core.objectTypes < / extendedPoint >

    < object >

    < types >

    < string > ecs:MdmCluster < / String >

    < / types >

    < label > #{mdmClusterLabel} < / label >

    < labelPlural > #{mdmClusterLabelPlural} < / labelPlural >

    icon <>#{mdmClusterIcon} < / icon >

    < / object >

    < / extension >

    < / plugin >

    Thanks for your help, laurentsd. I think that I managed to find the problem (actually, it looks like some sort of bug).

    I think there is a problem when the word "cluster" appears in the object type, because when I changed the type of the object to "ecs:mdmCluster" to "ecs: something ' in all places where it appears, everything started working. I'm sure that if collect you chassis and change the type "samples: chassis ' in ' samples: Cluster ', you will get the same problem I experienced. In any case, my problem is already solved.

  • Create a script of automatic action for the 3d rotation effect

    Is it possible to create a script action that automatically applyes rotation with specific settings 3d effect?

    An example would be when I press F2 it rotates the object instantly with my specific parameters without having to rely on anything else.

    Ok.

    you draw a shape, you want. Go to effect > 3D > Rotate and apply the desired settings.

    When your object is selected, go to the graphic Styles palette (window > graphic styles) and create the new graphic style (be it in the palette menu) or the small button. Call something memorable.

    Draw a new object, once again what you want. Open the actions palette (window > Actions). Create new action. Give it a name and assign it to a function key, and then click OK (the action will begin recording).

    Select your new object, then select your new graphic Style in the graphic styles palette. It should apply your 3D settings to the new object.

    Click on the button stop at the bottom of the Actions palette.

    create the new object, select it and press your chosen key. Enjoy.

  • Is it possible to create an action that moves an object?

    Is it possible to create an action that moves an object from its original position to another location?

    I think you can do it using the object effects.

Maybe you are looking for