Define a property of object on a global scale that belongs to another object.

Hello
In flex builder, I put on a Viewstack I manipulate using a bar of buttons. Inside of the viewstack is a browser accordion has a canvas for each of its viewstates. Inside of each canvas I have LinkButton that when you click on my various actions.
So, it looks like this:
ViewStack-> VBox - > Panel-> VBox - > accordion-> Canvas - > LinkButton etc. repeated
what I want to do, it's pass the LinkButton ID to a function when it is selected for what I can change some of its attributes. Thus, for example:
< mx:LinkButton id = "LB_change_banner_text" x = "10" y = "10" label = "text in the banner exchange.
Click = "myFunctionToChangeSomeAttributes (); "/ >


An example of a function would be to change the color of the link:

< mx:Style >
.redText
{
Color: #ff0000;
}
< / mx:Style >
< mx:Script >
<! [CDATA]
public function myFunctionToChangeSomeAttributes (): void
{
LB_change_banner_text.styleName = "redText";
}
[]] >
< / mx:Script >

The obvious problem is that it is not dynamic, so that I can send any object and manipulate its properties...
I don't know how send/recieve objects in actionscript 3, so my question is how to rewrite the function so that it receives a dynamic object that refers to an original. My hypothesis is to use pointers, but I'm not sure of the syntax.
Any help is greatly appreciated.
RFX

Hi again,
I did a little spin around and I managed to do the work. Here's what I did in case it helps someone else. If there is a better and more effective way to do so, I would like a guru, I am a novice flex/AS encoder.
The code AS:
public var previousMenu:Object = null;
public void ToggleMenuColor(cO:Object):void
{
If (previousMenu! = null) previousMenu.styleName = "blackText";
previousMenu = cO;
cO.styleName = "redText";
}
MXML:

It apears to work as expected. Hope this helps someone with a similar question.
RXF

Tags: Flex

Similar Questions

  • Name of the dynamic property of object in the table based on the value of a variable

    I have two paintings of custom class objects

    var obj1:Object1
    var obj2:Object2
    
    var array1:Array = [obj1[0], obj1[1], ...]
    var array2:Array = [obj2[0], obj2[1], ...]
    

    Object1 has a property named. Name while Object2 has a property named. Title.

    Now I have a common function including cab accepts an array (array1 or array2) and the name of property the object ("Name" or "Title") as input and needs to access this name of the property of the objects in the array:

    function myFunction(arr:Array, fieldName:String)
    {
        arr[0].fieldName  = "xxx";
    }
    

    the problem I have this achievement does not because the code in the function assumes that the property of that object in the table is actually a string "fieldName" while I want to dynamically determine the names of the fields based on the value of this variable, but cannot understand the syntax to do!

    Don't know if I'm clear - hope that makes sense... ;-) Thank you

    Hey p3pp3r,

    I think I understood you. Try the following and see if you get good results:

    function myFunction(arr:Array, fieldName:String)
    {
        arr[0][fieldName]  = "xxx";
    }
    

    Let me know how it turns out. Good luck!

  • Error 1055 to the property node: object reference is not valid. This error only occurs in a built application

    I use a WaveformChart to display multiple traces of data, the number of traces is variable, I use nodes property to set the number of traces that the digital display is visible or not, as there are more data increases the number of tracks and digital displays are made visible. In the design of Labview environment, everything works fine. However, when you run the application built so two or more traces must be mapped I see error 1055. I suspect that it is related to the visibility of the digital display on two or more traces of waveform. See attached VI.

    Why this error occurs?

    Thank you.

    Only trace

    Two traces

    Graphic WF only create their plots at development time.

    If you try to access a field that has never been there you get this error.

    To work around this detail, just the size the legend of the locations more than ever expected to use at the time of development, so that the parcels are created and available when you perform the compilation.

    Ben

  • Global scale

    Hi is there a kind of option, I can do a global scale for El captain? I just bought a 40 inch 4 k and while I can resize the desktop, files and fonts are small. When I try to view Option scale display... it only adjusts for this specific folder.

    System-> display-> radio button preferences-> choose a different 'resolution'

  • Can I use the timestamp to a global variable that is published to network to reduce network traffic?

    I would use a couple of network-has published the global variables that will contain large groups of data.  I want to host them on a device, but read them in several - consider a distributed control system.  The data will be updated very rarely, but when that happens, I want that all my GUI to know quickly.  I have all the GUI, simply read data 4 x per second (which would be fast enough), but I was wondering if there is a more elegant solution (always using global variables).  If I read only the timestamp 4 x per second each of the HMI, compare to the last reading and then interrogate the integer variable if timestamps are different, which will require fewer resources that just enter the integer variable each time?  In other words, the read timestamp uses the same amount of resources as the reading of the entire variable?

    With really simple code, assuming that the cluster "Data" is big enough, made...

    .. .get me no benefit on...

    mark3545 wrote:

    Which means that they are already doing what I want anyway, no?  If the reader is updated when it changes the writer, I can survey as often I want without increased traffic, correct?

    That is right.

  • File attributes can be changed from read-only on a global scale?

    I just finished using Easy Transfer from XP on a Win7 machine on another PC and find that almost ALL of my documents, spreadsheets and Access databases has been changed read-only.  I changed a couple of them to full access through the Properties menu, etc. and many prefer to be able to do on a global scale as I speak of hundreds of files that have been changed by this transfer.

    Is there a way to do this on all my files on my hard drive?

    Ronnie,

    It just seemed to me that all I really need to do is to find a way to change MY profile for equal to that of the admin. I did it just for a few files and these files are no longer read-only... !  I hesitate to change my system to an ADMIN login for security reasons.   I also changed the attributes of the lowest subfolder, then the above it and then I can open all of the files in these folders in r/w mode...

    So, is it possible to automate change the attributes of all files folder and subfolders?

    Fred615

    Hi Fred

    Yes, you must be connected to a Director profile.

    If all these files that you want to remove the read-only attribute on the D: drive, perform the following steps. Use these commands exactly as written, including spaces.

    1. open the elevated command prompt by using the profile administrator.

    The location should display C:\Windows\system32 >

    2 type cd\

    Press ENTER

    The location should now show C:\ >

    3. Type  D:

    Press ENTER

    4 location should now show D:\ >

    5 type attrib - r *. * /s /d

    Press ENTER

    This should remove the read-only attribute of all folders and files on that drive.

    Test and let us know the results.

    Concerning

  • Scale of content and then reset the global scale to 100%

    It is perhaps a strange question. But I'm looking at the first change the scene via the Document settings, then scale of content. I would then "reset" of the global scale to 100%.

    For example, if my internship is 1024 x 1024. I then change the scene at 512 x 512 and scale of content. Everything fits on the stage.

    The way he does is to apply scales at all. However, I do not want this, because I use Actionscript to extract images and positional information. What I need is a way to reset things so Flash think that the scene is "100% scale" and therefore will have images that are now 50% of the size of origin as well as other information such as being in fact 50% of positions.

    In other words, I'm looking for a way to scale things up or towards the bottom and then say it's worldwide now base... line so it treats it as if I created the file at this stage and the latest Flash content size.

    Hope it makes sense.

    Thank you.


    Ben

    I don't think this would be possible. An easy problem cases would be movieclips, where the scale could descend into the movieclip and resize vectors, to compensate for the change in scale, but it is unlikely to end up looking exactly the same. Bitmaps would be a problem too, Flash will re - sample each bitmap and replace the bitmapdata within the bitmap. Text is perhaps the most difficult part, Flash will have to change the font size of the field and hope that the text was still running in the same way.

    BTW, you can solve your ActionScript difficulty placing the entire experience into a movieclip, the current FLA document class would become the script of this movieclip class. All the details would work out ok, but you could evolve the new movieclip to any size, without the breaking of AS3.

  • How to change a property of objects from another VI

    Hi, I run my main vi. I have a preferences.vi window that opens.

    The preferenecs.vi opens with an invoke node.

    the preferences.vi must be able to fill the menu items of a control of the ring who lives in the main.vi

    I normally would you a property node, but as this object is in a another vi how can I communicate with her.

    I realize that a global variable seems to be able to pass values between the object and does not change the behavior of objects.

    Can someone help please!

    Thank you, Alec

    It should look like this.

  • Toolbox for CreateJS after that export instance names are not available in .name property of objects

    Inside of a loop, I connect an eventlistener click to several objects. Inside the event listener, I need to know which button or MovieClip is clicked on.

    In AS3, I used event.target.name and it seems that createjs is in favour because the .name property exists for all objects.

    But the problem is that the name property is set to zero in all objects. I tried to add inside js .name exported and that works, but to edit this file is not really an option.

    I use this code, for example:

    for (i = 1; i < = 150; i ++) {}

    myMC ["childMC" + i] .addEventListener ("click", onChildClick);

    }

    function onChildClick (event) {}
    Alert ("clicked target" + event.target.name);

    }

    Is this a bug or something, or better yet, is there a work around?

    Is there a reason you can't use the iteration children?

    for (i = 1; i<= container.getnumchildren();="">

    container.getChildAt (i) .addEventListener ("click", onChildClick);

    }

  • Strange property undefined object

    I created a clip and exported if ACE, naming the class "Tank." The clip has a couple of labels of image with a few photos inside on each label.

    The SWF file opens, it gets added dynamically to the scene as follows:

    var charMC:MovieClip = new Char();
    addChild (charMC);
    charMC.x = 164;
    charMC.y = 624;

    It works fine without error.

    However, further down I have a function that will call this clip and move it into a different image. As follows:

    function someFunction (): void

    {

    a few things

    charMC.gotoAndPlay ("start");

    }

    This does not work, and I get the error "Property not set of charMC access."

    Note This function has not yet been called yet, I get the error when compile the swf file. It makes no sense to me. What I am doing wrong? It seems that the variable/object is in scope, as it has already been set and even added to the scene.

    Where are you declaring and adding the clip?

    If var charMC:MovieClip = new Char();

    is inside a function, then it is not available everywhere, but inside this function.

  • The objects will not retain any color defined when the surrounding objects have their color changed

    Just Illustrator CC 19.0.0 was downloaded to me. When I place a line and then set its color, close objects can also have their color changed. This includes the items in the file of until I added the line, not on the same map-art objects. It is not universal, nor is it compatible. Objects already in the file are perhaps there for months, but a change is close will change their.

    The Illustrator files can still be an earlier version, and there were a number of illustrations that had black lines and text to white turned a few months back. As these illustrations are for a book, being unable to guarantee that the colors will stay together long enough to complete the illustration and export it tends to make unusable Illustrator for tasks of editions. I hope that InDesign and Photoshop do not have the same questions!

    nwjh,

    You must update to 19.1 (or 19.1.1 for Windows) or 19.2 (lattethe has some problems, then you can start with the former).

    If 19.1 (or 19.2) does not appear, disconnect and then reconnect the creative cloud application. After that, the 19.1 update must be visible in the creative application of Cloud.

  • Get the squares filter magnifying, even if it is defined by a circular object.

    So I created a magnifying in AS3 effect where the collected BitmapData is filtered through a circular shape.

    However, when I test this point, the distortion filter goes beyond the circular boundaries of the object and creates a square.

    When I go to hide the BitmapData, it says that I can't hide it.

    Problem:

    problem.jpg

    Image no:

    normal.jpg

    I just need the best method to do this circular BitmapData.

    My code:

    (the premise of this is to have a ball your dredge tthat and follows the speed of the jet to take account of bouncing speed on stage, when he bounces it enlarges an image, or you can drag it to enlarge)

    //Magnifying://
    /////////////////////////////////////////////////
    
    var dPoint:Point = new Point(0, 0);
    
    var dMap:BitmapData = new BitmapData(object.width, object.height, true, 0x808080)
    
    dMap.draw(colorMap_mc)
    
    removeChild(colorMap_mc)
    
    var dFilter:DisplacementMapFilter = new DisplacementMapFilter ();
    
    dFilter.scaleX         = 30    
    dFilter.scaleY         = 30    
    dFilter.componentX     = 1            
    dFilter.componentY     = 2            
    dFilter.mode        = "color"    
    dFilter.color        = 0x000000    
    dFilter.alpha         = 0            
    dFilter.mapPoint    = dPoint;    
    dFilter.mapBitmap    = dMap;        
    
    Image_mc.filters = [dFilter]
    
    Image_mc.addEventListener(Event.ENTER_FRAME, onFrame)
    
    function onFrame(e:Event){
    
        dPoint.x += ((object.x-colorMap_mc.width/2)-dPoint.x)
        dPoint.y += ((object.y-colorMap_mc.height/2)-dPoint.y)
        object.x += xSpeed;
        object.y += ySpeed;
        dFilter.mapPoint = dPoint
        Image_mc.filters = [dFilter]
    
    }
    
    
    
    
    

    My two colormap_mc and object are round and exactly the same size.

    The place is the size of the circular object, but alas, it is always a square.

    It seems that your movement is shifted down and to the right.

  • error: failed to get the value of property 'SetReturnValue': object is null or undefined

    Why did I get this error message when I open the weather channel desktop application?

    Hi Jimmy'Tidwell.

    1. Did you the latest changes on the computer?
    2. You have security software installed on the computer?

    Check out the link below for the weather channel support and check if it helps.

    Why do I get an error message?

    How do we uninstall Desktop?

    For further assistance, contact the vendor of the software.

    http://support.desktop.weather.com/ICS/support/default.asp?deptID=2552

  • Not defining the attributes of objects display

    Hello

    I created a table area and an attribute to view line heading in the annex. I have a created a transitional attribute also.

    I'm affecting transitional attribute vo in the controller application process, but the values are not reflected in the table.

    I give you the complete code, please help me.


    OATableBean tableBean = (OATableBean) webBean.findChildRecursive ("TableRN");
    pageContext.writeDiagnostics (this, "xxchrchecktableBean" + tableBean, 1);
    OAViewObject oaviewobject = (OAViewObject) am.findViewObject ("XXCHRCwkVendorReviewVO1");
    If (oaviewobject! = null)
    {
    oaviewobject.executeQuery ();
    String [] vendorDetailsArray = new String [5];
    vendorDetailsArray [0] = pageContext.getSessionValue ("XXCHRCWKRevSrcAgency") m:System.NET.SocketAddress.ToString ();
    vendorDetailsArray [1] = pageContext.getSessionValue ("XXCHRCWKRevVenRepName") m:System.NET.SocketAddress.ToString ();
    vendorDetailsArray [2] = pageContext.getSessionValue ("XXCHRCWKRevVenRepPhNo") m:System.NET.SocketAddress.ToString ();
    vendorDetailsArray [3] = pageContext.getSessionValue ("XXCHRCWKRevVenRepEmail") m:System.NET.SocketAddress.ToString ();
    vendorDetailsArray [4] = pageContext.getSessionValue ("XXCHRCWKRevVenRepAddress") m:System.NET.SocketAddress.ToString ();

    int fetchedRowCount = oaviewobject.getFetchedRowCount ();
    pageContext.writeDiagnostics (this, "fetchedRowCount =" + fetchedRowCount, 1);
    OARow oarow = null;
    if(fetchedRowCount >0)
    {
    for (int i = 0; i < fetchedRowCount; i ++)
    {
    oarow = (OARow) oaviewobject.getRowAtRangeIndex (i);
    If (oarow! = null)
    {
    oarow.setAttribute ("ColumnValue", vendorDetailsArray,);
    }
    }
    }

    }

    Published by: user13060916 on August 24, 2010 22:58

    Hello

    Try your code this way,

    OATableBean tableBean = (OATableBean) webBean.findChildRecursive ("TableRN");
    pageContext.writeDiagnostics (this, "xxchrchecktableBean" + tableBean, 1);
    OAViewObject oaviewobject = (OAViewObject) am.findViewObject ("XXCHRCwkVendorReviewVO1");
    If (oaviewobject! = null)
    {
    * / / oaviewobject.executeQuery (); do not run VO *.

    String [] vendorDetailsArray = new String [5];
    vendorDetailsArray [0] = pageContext.getSessionValue ("XXCHRCWKRevSrcAgency") m:System.NET.SocketAddress.ToString ();
    vendorDetailsArray [1] = pageContext.getSessionValue ("XXCHRCWKRevVenRepName") m:System.NET.SocketAddress.ToString ();
    vendorDetailsArray [2] = pageContext.getSessionValue ("XXCHRCWKRevVenRepPhNo") m:System.NET.SocketAddress.ToString ();
    vendorDetailsArray [3] = pageContext.getSessionValue ("XXCHRCWKRevVenRepEmail") m:System.NET.SocketAddress.ToString ();
    vendorDetailsArray [4] = pageContext.getSessionValue ("XXCHRCWKRevVenRepAddress") m:System.NET.SocketAddress.ToString ();
    int fetchedRowCount = oaviewobject.getFetchedRowCount ();

    RowSetIterator rowItr = vo.createRowSetIterator("rowItr");

    pageContext.writeDiagnostics (this, "fetchedRowCount =" + fetchedRowCount, 1);
    OARow oarow = null;
    if(fetchedRowCount >0)
    {
    for (int i = 0; i)<>
    {
    oarow = (OARow) rowItr.getRowAtRangeIndex (i);
    If (oarow! = null)
    {
    oarow.setAttribute ("ColumnValue", vendorDetailsArray);
    }
    }
    }

    }

    Let me know all the problems

    thanx
    Pratap

  • How to set the property node maximum xscale for several scale XY Chart

    Hello

    I use a graph XY with three X axis and three scales of axis Y to draw the three sets of data. This works well.

    What I do now is to set the Xscale.Maximum property node for one of the x-axis (the other two autoscale). If I click right in the (Create Blockdiagram; Node property; X scale; Maximum) I can not choose what x-axis I want to put the Maximum for.

    So my question: how to select a specific axis allows you to set the XScale.Maximum property node when having several axes?

    Thank you for your help, any suggestions are appreciated!

    Hello

    After some more research and experimentation, I found that using the scale property X Active I can determine/set for which the XScale.Maximum Xscale is used.

    This solved my problem.

    I hope someone else can save themselves a few hours with this thread!

    Thank you

Maybe you are looking for