How to access the elements in main.mxml file ActionScript?

I'm having problems creating a panel using the Extension Builder SDK. It seems that all the examples explain how a CS5 document using a control panel, but I found no examples of how to control the items in the Panel via ActionScript code.   Furthermore, we use CS Extension Builder SDK with Flash Builder 4.  Here's a simple example of were I'm stuck.

I create a project Extension generator for a panel of PS named: 'CSExtensionTest '.  In the main.mxml file create a button with id = "btnPSCode".

****************************************************************************************** *****************************************

File:

hand. MXML

****************************************************************************************** *****************************************

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

< mx:Application

' xmlns:mx = ' http://www.Adobe.com/2006/MXML " " layout ="absolute" historyManagementEnabled = "false""">

< mx:Script >

<! [CDATA]

[

Bindable ]

private var hostName:String = HostObject.mainExtension;

[]] >

< / mx:Script >

"" < mx:VBox height = "100%" width ="100%" verticalAlign = "middle" horizontalAlign ="center">

" < mx:Button id ="btnPSCode"label ="PS code run"click ="CSExtensionTestPhotoshop.run ()"enabled =" hostName.indexOf{('photoshop') >-1}"/ >

" < mx:Button id ="btnJSXCode"label ="code JSX run"click ="CSExtensionTestJSX.run ()"/ > "

< / mx:VBox >

< / mx:Application >

****************************************************************************************** *****************************************

How can I access the properties of this element in the CSExtensionTesJSX.as file?

****************************************************************************************** *****************************************

File:

CSExtensionTesJSX.as

****************************************************************************************** *****************************************

package

{

Import com.adobe.csxs.core.CSXSInterface;

Import com.adobe.csxs.core.csxs_internal;

Import com.adobe.csxs.types.SyncRequestResult;

Import mx.binding.utils.BindingUtils;

Import mx.core.ButtonAsset;

Import mx.core.mx_internal;

Import MX.utils.object_proxy;

public class CSExtensionTestJSX

{

public static function run():Sub

{

var myCSXS:CSXSInterface = CSXSInterface.getInstance ();

var result: SyncRequestResult = CSXSInterface.instance.evalScript ('jsxFunction');

btnPSCode.enabled = false;

}

}

}

****************************************************************************************** *****************************************

I get this error:

image001.png

I had initially written a panel using a Flex project and was able to access the properties of the items in the file main.mxml directly.  It seems that I can't do that.  Did I miss something in the code?  Am I missing some kind of library?  I'm sorry, I'm not very experienced in the development of Adobe, but we are trying to become more involved in the development of plugins and extensions for CS5.  Any help will be greatly appreciated.

You must pass a reference to your object main mxml in the run method. For example:

hand. MXML:


http://www.Adobe.com/2006/mxml"layout ="absolute"historyManagementEnabled ="false">
   
       

[Bindable]
private var hostName:String = HostObject.mainExtension;
           
]]>
   
   
       
   

testJSX.as:

package
{
import com.adobe.csxs.core.CSXSInterface;
import com.adobe.csxs.types.SyncRequestResult;
   
Import mx.controls.Button;

public class testJSX
{
public static void run(m:main):void
{
var result: SyncRequestResult = CSXSInterface.instance.evalScript ("jsxFunction");
var b:Button = m.myButton;
}
}
}

HTH.

Tags: Creative Suites

Similar Questions

  • How to access the main .mxml file component control?

    I have a .mxml main while in which I imported custom "popUpWindow" component using the statement "import components.popUpWindow". In main .mxml file, I show more later this component in the form of pop-up window using the Popup Manager class:

    var popUpWin:IFlexDisplayObject;
    popUpWin = PopUpManager.createPopUp (Thi, popUpWindow, true);

    Once the component is displayed, how can I access using the actionscript component TextInput control (specifically the .text property) my main .mxml file?

    Thank you

    bdeen I think you have it bad: P I think he wants to access a property in the main application window.

    Give the textInput id and then on your main application you can do this for example:

    var test: String = popUpWin.textInputName.text;

    Please note that it is recommended to do a casting for the popup window:
    popUpWin = popUpWindow (PopUpManager.createPopUp (Thi, popUpWindow, true));

  • How to access the tool feather in 13 elements Adobe? All I can find is the pencil.

    How to access the tool feather in 13 elements Adobe? All I can find is the pencil.

    Unfortunately, the pen tool is only in full Photoshop, not in any version of the EP. The closest is the text on the custom path tool, which has a kind of rudimentary pen tool to create the path where you want to place the text.

  • How to access the functions on my main SWF of my external SWF?

    Hello someone can help me how to access the functions on my main SWF file of a loaded SWF file?

    Forget using parent. Send an event to the place.

    btn3.addEventListener(MouseEvent.CLICK, btnClickHandler);
    function btnClickHandler(e:MouseEvent):void {
         dispatchEvent(new Event("categoryClick");
    }
    

    In your main swf file, listen for the complete event on the Loader.contentLoaderInfo.

    In the complete event handler, add an event listener for the categoryClick (or you have chosen to call it) on the loaded swf file.

    // event handler triggered when external swf is loaded
    function loaderCompleteHandler(event:Event) {
        (event.currentTarget.content as MovieClip).addEventListener("categoryClick", categoryClickHandler);
    }
    
    function categoryClickHandler(event:Event):void {
        trace("category button clicked in loaded swf");
    }
    

    And remember, whenever you use root or parent, God kills a kitten.

  • How to access the CLI Mode in cisco sf 302 - 08 p 8-port 10/100 Managed switch

    Hello

    Can someone help me on how to access the CLI mode in cisco sf 302 - 08 p 8-port 10/100 Managed switch. I treid the each method they mentioned in the administration guide. I am not able to enter the command debug mode and comand menu after resetting the default password. Once connected, sound directly to guide me to switch main menu.

    Hello FAL, Mark,.

    Thank you for your participation in the community of support to small businesses. My name is Nico Muselle of Cisco Sofia HWC.

    To access the CLI, you must make sure that the version of the firmware on your switch is at least 1.1.0.73 or preferably higher. Then activate telnet or ssh on the switch and opening of these sessions or a console session you will see that you are in CLI mode. You can return to the console to function menu using the menucommand.

    I hope that answers your questions!

    Best regards

    Best regards

    Nico glacier

    Senior Network Engineer - CCNA - CCNA security

  • How to access the source timecode in the timeline?

    Hello

    When I enter a time code while in the panel mounting, the prescription jumps to absolute timecode. How to access the source timecode of the clip on the prescription is?

    THX,

    Jayson

    You can't directly.  You need to charge this element in the Source monitor, where you can go the desired timecode, and then make a game framework reverse to get to the very image of this sequence.

  • How to access the Clipboard Premiere Pro?

    I don't know if I need to use the SDK for it or not.

    Basically, I want to be able to COPY items different lots of first, as presets, transitions and clips... in the Clipboard, one at the time and then all of this Clipboard information SAVE somewhere where it will not be overwritten when the next thing is copied to the Clipboard.

    Then I'll program a system (probably using AutoHotKey) where any particular item can be recalled and placed in the active Clipboard, then pasted directly into the first as usual.

    This would allow me to use customized keyboard shortcuts to instantly apply any effect I want, any transition I want and any group of clips that I want the timeline... incredibly easy and flawless.

    I tried to use the function clipboardAll() to autohotkey (Clipboard and ClipboardAll), but it does work for the copied elements in first... only for the text and images and things like that. It seems to me that the first has its own special Clipboard it uses for the more complicated things like copy effects or clips on the timeline.

    Once again, my question is, how to access the Clipboard Premiere Pro ? Where this file is located in the Windows? I searched through all folders in AppData first and I don't see anything that resembled the Clipboard information... I do not know if this is the right place to look.

    I downloaded the SDK, but I don't see any information on the Clipboard in the included help file, so I don't know if the SDK may be useful for this.

    I am so, so grateful if someone could help me with this. I'm a video editor, not a programmer, so this kind of thing is not very easy for me.

    There is no way to access the Clipboard Premiere Pro, in the way you described.

    What do you do with the items you want to copy? Perhaps there is another way.

  • How to access the attributes of VO through binding...

    I have a lookup table that has 2 columns namely encode and attrib.

    I created a ViewObject with SQL like:

    SELECT THE CODE, REFER TO THE STUDY_TYPE_CODES

    And he stated in an Application Module.

    Now I want to post it to the end-user as part of a selection
    that should show REFER to but returns the value CODE.

    I want to iterate the elements and generating the choices myself.
    So I tried this on my page:

    < af:selectOneChoice label = "Test" required = "true" >

    < af:forEach elements = "#{bindings." Var StudyTypeCodesVVO1.allRowsInRange}"="row">

    "< af:selectItem value =" #{row.code} "label =" #{row.describ} "id ="si3"/ >

    < / af:forEach >

    < / af:selectOneChoice >

    It gives an error. Looks like how I use
    "#{row.code}" or "#{row.describ} ' is false.  If I ' # {line} "then
    It's OK, and I could see that the line is a

    ViewRow [oracle.job.Key []]

    But I do not know how to access attributes by name 'Code' and ' means ".". " I also tried
    "#{rank." Code}"with the capital and it does not work.

    How to access the attributes 'code' and 'describe' of each line?

    Kindly help.

    Thank you.

    Check the RangeSize property on the iterator to pageDef.

    Dario

  • Define and access the elements of the application

    Hello

    How can I set and access the values of the elements of the application of the package? is ' t recommended to access the elements of the procedure?

    Thank you

    Hello

    PL/SQL functions or procedures without worrying whether or not they are packed:

    procedure: APEX_UTIL. SET_SESSION_STATE ('MY_ITEM', 'myvalue');

    get the function: V ('MY_ITEM')

    Regards Garry

  • To access the elements of the scene, via a SWF file that is loaded inside the scene

    -J' I A.fla.

    -A.fla includes buttons, video clips and also B.swf is loaded in A.fla with a CHARGER

    -I want to access the elements in A.fla, from codes actionscript inside B.fla to change these video clips and buttons based on the actions going on in B.swf

    for example, lets say there is an X button in A.fla and there is a button there B.fla, B.swf is loaded into A.fla, and I want the key Y to delete X when you click the button.

    General question: to access the elements in a stage, via a file SWF loaded in this stage.

    This is a way silly to explain: there is this pregnant mom, a child is loaded inside him, now, I want the codes inside the child, access to MOM

    elements, such as lets say, I want the code of the child can make the eyes of MOM flashing faster. logically there is something inside something else, but I want to have access to the bigger picture of what is loaded. I hope I can get my point across.

    I repeat what I replied to your other psoting for this same question and adding just a little bit more...

    If you load a swf into another using the Loader class, then the charger itself is the parent of the loaded swf file, so MovieClip (parent.parent) could help you target the timeline that the charger was born.

    The way to have a loaded file to speak to a parent file is through the sending of events that the parent assigns headphones for after the file has been loaded.  Here is a link to an announcement that could help explain how to implement this.

    http://forums.Adobe.com/thread/470135?tstart=120

    And here's a quick example...

    Example:

    Add something to raise the event in the child:

    dispatchEvent (new Event ("eventTriggered"));

    In your SWF to loading/parent, listen for the complete event on the Loader.contentLoaderInfo.  In the complete event handler, add a listener for the event on the loaded swf file.

    triggered when external swf loading event handler
    function loaderCompleteHandler(event:Event) {}
    (event.currentTarget.content as MovieClip) .addEventListener ("eventTriggered", eventHandler);
    }

    function eventHandler(event:Event):void {}
    trace ("event sent in loaded swf");
    }

    So in your A.swf, you should have the other event and functions of event handler that would take care of control buttons.   Event listeners could be assigned to the B.swf after that that it has loaded.  In your B.swf you just have it dispatches an event and the A.swf manage self adjustments you need taken care of.  This allows the two files to be independent of each other on a functional level.

    Regarding the buttons that you want to disable, you can either use the removeEventListener() method to remove the listeners you have assigned, or you can set the mouseEnabled property to false, or you can set the visible property to false.

  • How to access the info in my iCloud account

    How to access the info in my iCloud account?

    You can access much of the iCloud.com on a computer or through specific applications on your mobile device such as contacts, calendars, iCloud Drive, Photos. What exactly you were looking for and what type of device.

  • How to access the bios?

    I am trying to install a new OS, how to access the bios on my HP Pavilian dv8?

    Hello:

    You should be able to access the BIOS by pressing the F10 key as soon as you see the HP welcome screen.

    Paul

  • How to access the BIOS on a Pavilion Elite e9237c with mouse and keyboard wireless?

    I have a desktop computer Pavilion Elite e9237 with a wireless keyboard and mouse. I tried to access the BIOS by pressing F10 at startup with no luck, and I can't access any of the other menus for the start-up eiither. I don't have a PS/2 port on my computer, so I can't get a wired keyboard and mouse. Does anyone know how to access the BIOS with this configuration?

    I bought a USB keyboard and he answered in the same way... No bios access. I then studied why it did not work and discovered that it was the way in which he has been connected to the computer. I had initially plugged into a USB hub when he was not working and I moved it directly into a USB port and it works! I plugged my keyboard wireless directly into the USB port and it works too! Thanks for your help... I wouldn't have thought of it if it wasn't for to recommend you the USB keyboard.

  • How to access the firefox on laptop Office keeping all the features?

    How to access the firefox on laptop Office keeping all tabs and bookmarks?

    Hello

    You may be able to do this in Firefox Sync configuration on both devices. Please see for detailed instructions.

  • Qosmio G30-126 - how to access the bios!

    I have a laptop Qosmio G30-126 and I don't know the key to enter the bios to change real estate for the HARD drive or something... then how to access the bios? What is the key for the bios?

    Hello

    Try pressing the F2 key by turning on the device.
    The Toshiba notebooks supported the ESC and then F1 button
    If these two options are possible

Maybe you are looking for