Attached corresponding image in mouse without using event.target.name in actionscript 3

Hi,
AS3:
How to get general id (or) name from xml loaded images. bcoz, i want to drag and drop that images in generic method. Now, i currently used the event.target.name for each one.
So, code length was too large. See my code below.
/*********loading images through xml********/
var bg_container_mc:MovieClip
var bg_bg_myXMLLoader:URLLoader = new URLLoader();
bg_bg_myXMLLoader.load(new URLRequest("xml/backgroundimages.xml"));
bg_bg_myXMLLoader.addEventListener(Event.COMPLETE, processXML_bg);
function processXML_bg(e:Event):void {
          var bg_myXML:XML=new XML(e.target.data);
          columns_bg=bg_myXML.@COLUMNS;
          bg_my_x=bg_myXML.@XPOSITION;
          bg_my_y=bg_myXML.@YPOSITION;
          bg_my_thumb_width=bg_myXML.@WIDTH;
          bg_my_thumb_height=bg_myXML.@HEIGHT;
          bg_my_images=bg_myXML.IMAGE;
          bg_my_total=bg_my_images.length();
          bg_container_mc = new MovieClip();
          bg_container_mc.x=bg_my_x;
          bg_container_mc.y=bg_my_y;
          ContentHead.addChild(bg_container_mc);
          for (var i:Number = 0; i < bg_my_total; i++) {
                   var bg_thumb_url=bg_my_images[i].@THUMB;
                    var bg_thumb_loader = new Loader();
                   bg_thumb_loader.load(new URLRequest(bg_thumb_url));
                   bg_thumb_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbLoaded_bg);
                   bg_thumb_loader.name="bg_load"+i;
                   bg_thumb_loader.addEventListener(MouseEvent.MOUSE_DOWN, bg_down)
                   bg_thumb_loader.x = (bg_my_thumb_width-18)*bg_x_counter;
                   bg_thumb_loader.y = (bg_my_thumb_height-45)*bg_y_counter;
                   if (bg_x_counter+1<columns_bg) {
                             bg_x_counter++;
                   } else {
                             bg_x_counter=0;
                             bg_y_counter++;
function thumbLoaded_bg(e:Event):void {
          var my_thumb_bg:Loader=Loader(e.target.loader);
         var sprite:Sprite = new Sprite();
          var shape:Shape = new Shape();
          shape.graphics.lineStyle(1, 0x0098FF);
          shape.graphics.drawRect(e.target.loader.x-2, e.target.loader.y-2, e.target.loader.width+4, e.target.loader.height+4);
          sprite.addChild(shape);
          sprite.addChild(my_thumb_bg);
          sprite.x=4;
          bg_container_mc.addChild(sprite);
          my_thumb_bg.contentLoaderInfo.removeEventListener(Event.COMPLETE, thumbLoaded_bg);
//  get name for each image. 
I want to change this code in generic method. do needful.
function bg_down(event:MouseEvent):void {
          var bg_name:String=new String(event.currentTarget.name);
          var bg_load:MovieClip=event.currentTarget as MovieClip;
          if (event.currentTarget.name=="bg_load0") {
                  var alaska_mc:alaska_png=new alaska_png();
                   addChild(alaska_mc);
                   alaska_mc.x=stage.mouseX;
                   alaska_mc.y=stage.mouseY;
                   alaska_mc.name="alaska_duplicate"+alaska_inc;
                   alaska_inc++;
                   alaska_mc.startDrag(false);
                  alaska_mc.addEventListener(MouseEvent.MOUSE_UP, stdrag);
                   alaska_mc.addEventListener(MouseEvent.MOUSE_UP, stdrag);
          if (event.currentTarget.name=="bg_load1") {
                   var lake_mc:lake_png=new lake_png();
                   addChild(lake_mc);
                   lake_mc.x=lake_mc.mouseX;
                   lake_mc.y=lake_mc.mouseY;
                   lake_mc.name="lake_duplicate"+lake_inc;
                   lake_inc++;
                   lake_mc.startDrag(false);
                   lake_mc.addEventListener(MouseEvent.MOUSE_UP, stdrag);
          if (event.currentTarget.name=="bg_load2") {
                   var mountn_mc:mountn_png=new mountn_png();
                   addChild(mountn_mc);
                   mountn_mc.x=mountn_mc.mouseX;
                   mountn_mc.y=mountn_mc.mouseY;
                   mountn_mc.name="mountn_duplicate"+mountn_inc;
                   mountn_inc++;
                   mountn_mc.startDrag(false);
                   mountn_mc.addEventListener(MouseEvent.MOUSE_UP, stdrag);
          if (event.currentTarget.name=="bg_load3") {
                   var town_mc:town_png=new town_png();
                   addChild(town_mc);
                   town_mc.x=town_mc.mouseX;
                   town_mc.y=town_mc.mouseY;
                   town_mc.name="town_duplicate"+town_inc;
                   town_inc++;
                   town_mc.startDrag(false);
                   town_mc.addEventListener(MouseEvent.MOUSE_UP, stdrag);
          if (event.currentTarget.name=="bg_load4") {
                   var water_mc:water_png=new water_png();
                   addChild(water_mc);
                   water_mc.x=water_mc.mouseX;
                   water_mc.y=water_mc.mouseY;
                   water_mc.name="water_duplicate"+water_inc;
                   water_inc++;
                   water_mc.startDrag(false);
                  water_mc.addEventListener(MouseEvent.MOUSE_UP, stdrag);
          if (event.currentTarget.name=="bg_load5") {
                   var city_mc:city_png=new city_png();
                   addChild(city_mc);
                   city_mc.x=city_mc.mouseX;
                   city_mc.y=city_mc.mouseY;
                   city_mc.name="city_duplicate"+city_inc;
                   city_inc++;
                   city_mc.startDrag(false);
                  city_mc.addEventListener(MouseEvent.MOUSE_UP, stdrag);
          if (event.currentTarget.name=="bg_load6") {
                    var citywide_mc:citywide_png=new citywide_png();
                   addChild(citywide_mc);
                   citywide_mc.x=citywide_mc.mouseX;
                   citywide_mc.y=citywide_mc.mouseY;
                   citywide_mc.name="citywide_duplicate"+citywide_inc;
                   citywide_inc++;
                   citywide_mc.startDrag(false);
                  citywide_mc.addEventListener(MouseEvent.MOUSE_UP, stdrag);
          if (event.currentTarget.name=="bg_load7") {
                   var downtown_mc:downtown_png=new downtown_png();
                   addChild(downtown_mc);
                   downtown_mc.x=downtown_mc.mouseX;
                   downtown_mc.y=downtown_mc.mouseY;
                   downtown_mc.name="downtown_duplicate"+downtown_inc;
                   downtown_inc++;
                   downtown_mc.startDrag(false);
                  downtown_mc.addEventListener(MouseEvent.MOUSE_UP, stdrag);
          if (event.currentTarget.name=="bg_load8") {
                   var powerlines_mc:powerlines_png=new powerlines_png();
                   addChild(powerlines_mc);
                   powerlines_mc.x=powerlines_mc.mouseX;
                   powerlines_mc.y=powerlines_mc.mouseY;
                   powerlines_mc.name="powerlines_duplicate"+powerlines_inc;
                   powerlines_inc++;
                   powerlines_mc.startDrag(false);
                  powerlines_mc.addEventListener(MouseEvent.MOUSE_UP, stdrag);
          if (event.currentTarget.name=="bg_load9") {
                   var tropical_mc:tropical_png=new tropical_png();
                   addChild(tropical_mc);
                   tropical_mc.x=tropical_mc.mouseX;
                   tropical_mc.y=tropical_mc.mouseY;
                   tropical_mc.name="tropical_duplicate"+tropical_inc;
                   tropical_inc++;
                   tropical_mc.startDrag(false);
                  tropical_mc.addEventListener(MouseEvent.MOUSE_UP, stdrag);
          if (event.currentTarget.name=="bg_load10") {
                   var waters_mc:waters_png=new waters_png();
                   addChild(waters_mc);
                   waters_mc.x=waters_mc.mouseX;
                   waters_mc.y=waters_mc.mouseY;
                   waters_mc.name="waters_duplicate"+waterthumb_inc;
                   waterthumb_inc++;
                   waters_mc.startDrag(false);
                  waters_mc.addEventListener(MouseEvent.MOUSE_UP, stdrag);
Please suggest me if any  one.
Regards,
Viji. S

for each loader created, create a movieclip and add your loader to the movieclip.  assign all the properties you want to retrieve later to the movieclip and assign your event listeners to the movieclip.

Similar Messages

  • How do I use event.target.name in AS2?

    Thanks to kglad I was able to see how event.target.name in AS3 could make a button load a movieclip with the same namesake.
    I'm doing the same thing now in AS2 but don't know what to write instead of event.target.name.
    And so at the moment each button pushes info into an array and then a function uses that to decide which movieclip to attach to a holder after it has faded out once, and then fades in again...
    // ***** IMAGE GALLERY START ***** //
    // Add image to holder
    imgholder.attachMovie("img0", "image0_0", 1)
    // Array
    var nextLoad = ["img0"];
    // Btn listeners
    img5.onRelease = function() { trace (nextLoad); nextLoad.pop(); nextLoad.push("img5"); btnClick() } // Written on 1 line
    img4.onRelease = function() { trace (nextLoad); nextLoad.pop(); nextLoad.push("img4"); btnClick() }
    img3.onRelease = function() { trace (nextLoad); nextLoad.pop(); nextLoad.push("img3"); btnClick() }
    img2.onRelease = function() { trace (nextLoad); nextLoad.pop(); nextLoad.push("img2"); btnClick() }
    img1.onRelease = function() {
    nextLoad.pop();
    nextLoad.push("img1");
    btnClick()
    img0.onRelease = function() {
    nextLoad.pop();
    nextLoad.push("img0");
    btnClick()
    // The btn function
    function btnClick() {
    trace ("click");
    var myImgTween:Object = new Tween(imgholder, "_alpha", Strong.easeOut, 100, 0, 1, true);
    myImgTween.onMotionFinished = function() {
    fadeOutImg();
    // The btn function part II
    function fadeOutImg() {
    trace ("fadeOutImg");
    imgholder.attachMovie(nextLoad, "image1_1", 1);
    var myImgTween:Object = new Tween(imgholder, "_alpha", Strong.easeOut, 0, 100, 1, true);
    I know I should be able to push the button name into the array, but am having to use a string... I'm sure my code is cumbersome!! But it works. I've tried pushing the button name but it end up including the full stage reference.
    Is there a cleaner way of doing this using event.target.name?
    Thanks for looking!

    There is no event.target in AS2. However since AS2 has no way of remembering the scope object where the target object resides, you can use this to your advantage to retrieve the name of the target by using the "this" command in the function whenever you use the above format "mc.onPress = myfunc". FYI, the popular workaround Delegate, made it possible that when you called "this" in the function, you could retrieve the scope object where the target instance resides. So without its use, "this" will return the name of the target object. Anyway this is the code you can use:
    imgholder.attachMovie("img0","image0_0",1);
    var nextLoad = ["img0"];
    img5.onRelease = onImgRelease;
    img4.onRelease = onImgRelease;
    img3.onRelease = onImgRelease;
    img2.onRelease = onImgRelease;
    img1.onRelease = onImgRelease;
    img0.onRelease = onImgRelease;
    function onImgRelease():Void {
       nextLoad.pop();
       nextLoad.push(this._name);
       btnClick();
    // The btn function
    function btnClick() {
       trace("click");
       var myImgTween:Object = new Tween(imgholder, "_alpha", Strong.easeOut, 100, 0, 1, true);
       myImgTween.onMotionFinished = function() {
          fadeOutImg();
    // The btn function part II
    function fadeOutImg() {
       trace("fadeOutImg");
       imgholder.attachMovie(nextLoad,"image1_1",1);
       var myImgTween:Object = new Tween(imgholder, "_alpha", Strong.easeOut, 0, 100, 1, true);

  • Enlarging an image on mouseover without using Flash

    Enlarging an image on mouseover without using Flash
    I use DW MX 2004 with Windows 2000
    I want to create the following effect. I have two versions of
    an image,
    geyso_scr... (which is screen size) and geyso_sm (which is
    small). On
    mouse-over I want a larger window to open on top of my html
    page (but
    less than the full screen) and show the larger image file in
    whatever
    size I have created it.
    One mouse-off I want to restore the original image.
    I tried this with a straight image swap on the following
    page:
    http://www.tudo.co.uk/testing/hospiz_stiftung/shell/contents/vorstand/vorstand.html
    see row 2, image 1, Peter von Geyso.
    This works all right (on mouseover there is a shift of about
    1 px) but
    the screen sized image has been sized down to the original
    image (sm image).
    How can I conveniently get the large image hovering on top of
    the
    existing page?
    Can someone recommend a tutorial which describes how this is
    done?
    Or is there a utility which does it?
    On similar lines, a client wants to display a list of items
    as text in
    comparatively small font. On mouse-over he wants the
    list-item in
    question to become slightly larger (not only to change colour
    etc). Can
    that be done without converting the text into images.
    Is there any tutorial for that?
    (No point in arguing with the client that the text should be
    made large
    enough to read in the first place. I have tried that in
    vain.)
    Thanks for your help.
    Adrian

    netlace design wrote:
    > Hey Adrian,
    >
    > Maybe this will work for you. Take a look here at this
    demo
    >
    >
    http://www.cssplay.co.uk/menu/magnify
    Hi Netlace Design,
    This looks interesting, but where do I get the code for this.
    How is it
    done without javascript.
    Thanks,
    Adrian

  • How do I use the event.target.name String with an external dispatchEvent?

    ...I hope the title question makes sense...
    On my stage I have an externally loaded SWF with a button. When clicked the button dispatches an event to the main stage.
    On the main stage a listener then loads an SWF into a loader called gallery.
    The gallery loader is also being shared by buttons on the main stage which use the event.target.name String to call in SWFs with corresponding names.
    I am using Tweens to fade-out and -in content to the gallery when a button is pressed.
    Loading the SWFs was working until I tried to create a universal button function for the dispatchEvent buttons...
    The problem I have is that I don't know how to define the String to tell the newSWFRequest where to find the SWF when triggered by the external buttons.
    (I may be doing this all wrong... but figured the best way to load an SWF on to the main stage from an external SWF was by using dispatchEvent??)
    My code triggers the Event and the gallery loader fades out, but then it cannot find the new SWF:
    Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.
    Please can someone help me understand the way to make the String point in the right direction? (I think the only errors are in bold below)
    Code:
    var myTweenIn2:Tween;
    var myTweenOut2:Tween;
    var nextLoadS2:String;
    // Listen for external event dispatched from external btns
    addEventListener("contactStage", btnClickExtrnl);
    function btnClickExtrnl(e:Event):void {
    nextLoadS2 = ?????
    myTweenOut2=new Tween(gallery,"alpha",None.easeOut,gallery.alpha,0,0.2,true);
    myTweenOut2.addEventListener(TweenEvent.MOTION_FINISH,tweenOutCompleteF2);
    // Btns Universal function
    function tweenOutCompleteF2(e:TweenEvent){
    myTweenOut2.removeEventListener(TweenEvent.MOTION_FINISH,tweenOutCompleteF2);
    myTweenOut2=null;
        var newSWFRequest:URLRequest = new URLRequest("swfs/" + nextLoadS2 + ".swf");
    myTweenIn2 = new Tween(gallery, "alpha", None.easeOut, gallery.alpha, 1, 0.2, true);
        gallery.load(newSWFRequest);
        gallery.x = Xpos;
        gallery.y = Ypos;
    Thank you.

    That works – thank you!
    I'm now using this code to fade in each of the SWFs:
    function contactStage(e:MouseEvent):void {
        var newSWFRequest:URLRequest = new URLRequest("swfs/"+e.currentTarget.name+".swf");
        myTweenIn = new Tween(gallery,  "alpha", None.easeOut, 0, 1, 0.2, true);
        gallery.load(newSWFRequest);
        gallery.x = Xpos;
        gallery.y = Ypos;
    But I cannot add the fade out function. I have amended the above code to create:
    var myTweenOutX:Tween;
    var myTweenInX:Tween;
    function contactStage(e:MouseEvent):void {
    myTweenOutX=new Tween(gallery,"alpha",None.easeOut,gallery.alpha,0,0.2,true);
    myTweenOutX.addEventListener(TweenEvent.MOTION_FINISH,tweenOutCompleteFX);
    function tweenOutCompleteFX(e:TweenEvent){
    myTweenOutX.removeEventListener(TweenEvent.MOTION_FINISH,tweenOutCompleteFX);
    myTweenOutX=null;
        var newSWFRequest:URLRequest = new URLRequest("swfs/"+e.currentTarget.name+".swf");
    myTweenInX = new Tween(gallery,  "alpha", None.easeOut, 0, 1, 0.2, true);
        gallery.load(newSWFRequest);
        gallery.x = Xpos;
        gallery.y = Ypos;
    But get this error:
    ReferenceError: Error #1069: Property name not found on fl.transitions.Tween and there is no default value.
    at ACOUSTIC_fla::MainTimeline/tweenOutCompleteFX()[ACOUSTIC_fla.MainTimeline::frame1:110]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at fl.transitions::Tween/set time()
    at fl.transitions::Tween/nextFrame()
    at fl.transitions::Tween/onEnterFrame()
    Where am I going wrong?

  • Passing event target name to text field

    Hi There,
    I'm new to 3.0 and can use some help here... should be an
    easy one for you experts...
    I just need to pass an event target name to a text field:
    square.addEventListener(MouseEvent.MOUSE_DOWN,downObj);
    function downObj(event:MouseEvent){
    targetObj = event.target;
    mydrag.visible = true;
    targetObj.startDrag();
    mydrag.addEventListener(Event.ENTER_FRAME, dragClip);
    target_txt.text = String(event.target);
    I've also tried:
    target_txt.text = event.target;
    but no luck so far..
    Any help would be highly appreciated.
    Cheers...
    Bruno Aun
    Flash + Coldfusion Developer
    http://www.BrunoAun.com

    That's right...
    target_txt.text = String(event.target
    .name);
    works like a charm.
    thank you!

  • Help with event.target.name

    I am very green with actionscript and coding in general so please forgive me if I am asking something that sounds super simple.
    Is it possible to take "event.target.name" value which in my case would be something like "SW5005_mc" and change that value.
    I use that value right now to tell another clip to gotoAndStop(event.target.name); which I have frames labeled the same as the event.target.name.
    I would like to take the value of event.target.name for instance "SW5005_mc" and remove the "_mc" and put a dash in between the "SW" and the "5005"
    to get "SW-5005" which then I would pass into a text field.
    I really don't know where to begin or if this is possible.
    Thanks for any help or suggestions,
    Chris

    yes you can do it with String manipulation, check out the various String Class methods, some examples here:
    http://www.wuup.co.uk/as3-basics-string-manipulation-in-actionscript-3/
    http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/String.html

  • Using event.target.submitForm to submit a PDF and XML attachment in a single email.

    I have a button on a PDF form which emails a PDF and XML attachment of the current form in two seperate emails. The code is as follows:
    event.target.submitForm({cURL:"mailto:" +  "[email protected]" +"?subject="+"Request for action " + "&body=Please find attached..." ,cSubmitAs:"XML",cCharset:"utf-8"});
    event.target.submitForm({cURL:"mailto:" +  "[email protected]" +"?subject="+"Request for action " + "&body=Please find attached..." ,cSubmitAs:"PDF",cCharset:"utf-8"});
    This results in 2 seperate emails, when all I need is a single email with two attachments. Is there a way to do this?

    As far as I know you can only attach one attachment at once.

  • Add an item into announcement list in site collec. and repeat the same in all the sub webs' announcement list without using event receiver

    hi,
    I have a requirement: in my site collection i have an announcement list. and in my site collection  some 600+ sub sites exist. sharepoint admin uploads an announcement into this rootweb's announcement list. now is there any way
    i can add the same announcement -which has title, description, date time etc .- to all the 600+ sub sites' announcement list?
    i know , if i write a list item event receiver i will be able to iterate through eacha nd every subweb of my site collec and add this item into those sub web's  announcement list. But, without writing an event receiver and creating and deploying
    another wsp and avoiding all those headache, is it possible to achieve this requirement?
    any other approaches are highly appreciated!

    Hi,
    As a workaround, we can create a winform application for admin use only to add the item to all the sub web's announcement list.
    Developing Sharepoint Windows Forms
    http://www.codeproject.com/Tips/566370/Developing-Sharepoint-Windows-Forms
    Best Regards,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • PNG transparency lost using event.target.loader.content.bitmapData

    I load a png 24 (tripple checked alpha is ok)
    override public function loadData():void
         var request:URLRequest = new URLRequest(url);
         var loader = new Loader();
         loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageloadedSuccess);
         loader.load(request);
    public function imageloadedSuccess(e:Event):void
         showPNG(e.target.loader.content.bitmapData);
    in Air 1.5 png (e.target.loader.content.bitmapData) has no transparency
    same code using Flash 10 export transparency is there.
    both of course loading same png file.
    Is this a known issue?
    I haven't tried yet using 2.0
    is there a workarround to load external png and keep the transparency?
    thx by advance
    Fabrice

    for each loader created, create a movieclip and add your loader to the movieclip.  assign all the properties you want to retrieve later to the movieclip and assign your event listeners to the movieclip.

  • Help in making this GUI without using IDE (snapshot attached)

    [Layout image| [https://rapidshare.com/files/2954811682/layout.JPG]]
    hi, i am new java swing library and i want to create a layout just like a image posted above without using IDE.
    i need some idea/help regarding two issues which i m facing at the moment one how to set the size of the button and how im suppose to set the alignment of labels,textboxes and buttons according to the image here is the source code below :
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.FlowLayout;
    import java.awt.Font;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JCheckBox;
    import javax.swing.JComboBox;
    import javax.swing.JFileChooser;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JPasswordField;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import javax.swing.JTextField;
    import javax.swing.border.TitledBorder;
    public class Form extends JFrame {
    private JLabel lblUserName;
    private JLabel lblNewPassword;
    private JTextField txtUserName;
    private JPasswordField txtNewPassword;
    private JButton btnLogin;
    private JButton btnClear;
    private JPanel mainPanel;
    private JPanel centerPanel;
    public Form() {
    // initialize the components
    initComponents();
         // add the components
    addComponents();
         // add the listeners
    //addListeners();
    // display components
    displayComponents();
    private void initComponents() {
    getContentPane().setLayout(new FlowLayout(FlowLayout.CENTER, 10, 10));
    mainPanel = new JPanel(new BorderLayout());
    centerPanel = new JPanel(new GridLayout(3, 4, 20, 5));
    lblUserName = new JLabel("Username : ");
    lblNewPassword = new JLabel("password : ");
    txtUserName = new JTextField(15);
    txtNewPassword = new JPasswordField(15);
    btnLogin = new JButton("Login");
    btnLogin.setPreferredSize(new Dimension(2,2));
    btnClear = new JButton("Clear");
    btnClear.setPreferredSize(new Dimension(2,2));
    private void addComponents() {
    centerPanel.add(lblUserName);
    centerPanel.add(txtUserName);
    centerPanel.add(new JLabel(""));
    centerPanel.add(lblNewPassword);
    centerPanel.add(txtNewPassword);
    centerPanel.add(new JLabel(""));
    centerPanel.add(new JLabel(""));
    centerPanel.add(btnLogin);
    centerPanel.add(btnClear);
    Font titleFont = new Font("San Serif",Font.PLAIN,12);
    Color titleColor = Color.blue;
    mainPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Admin Login",TitledBorder.DEFAULT_JUSTIFICATION,TitledBorder.DEFAULT_POSITION,titleFont,titleColor));
    mainPanel.add(centerPanel, BorderLayout.CENTER);
    getContentPane().add(mainPanel);
    private void displayComponents() {
    setTitle("Form");
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setSize(600, 200);
    setVisible(true);
    public void actionPerformed_BtnUpdate(ActionEvent e) {
    JOptionPane.showMessageDialog(this, "Your profile has been updated successfully.");
    public void actionPerformed_BtnBrowse(ActionEvent e) {
    JFileChooser fileChooser = new JFileChooser();
    fileChooser.showOpenDialog(this);
    public static void main(String[] args) {
    try {
    Form myForm = new Form();
         catch (Exception exception) {
    System.err.println("ERROR - " + exception.getMessage());
    Edited by: 932179 on May 4, 2012 1:30 PM
    Edited by: 932179 on May 4, 2012 1:30 PM

    Welcome to the forum.
    Take the list of +"All Known Implementing Classes"+ from here http://docs.oracle.com/javase/7/docs/api/java/awt/LayoutManager.html and find out what combination best fits your needs.
    I usually have some nested BorderLayouts and GridLayouts.
    When I need lables and input fields aligned I use GroupLayout (which I personally prefer over GridBagLayout...).
    Anyway, you may have got better answers if you postet this in the right place:
    Swing
    bye
    TPD

  • How to send the email without using server side (Php, java)

    How to send the (Run time image or file) Email & Attachment in Flex web application. without using php, java.

    Well, at some point your email needs to be handed over to an SMTP server. It's a fair amount of work, but if you want to just send an email you could open a socket to a mail server's SMTP port and follow the SMTP protocols to send your email.
    ActionScript sockets: http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9 b90204-7cf7.html
    SMTP protocol: http://tools.ietf.org/html/rfc821
    -- Tom

  • Hi. Can use events to look out for input switches from any DAQ board?

    I tried using events to detect signals from input switches Advantech PCL-8181L, but it seems no response.
    I have read an article about the events that user controls can trigger and some external IO cannot.
    Is there any one know how I can get the program to monitior them all the time without using event function?

    Astroboy,
    I am not sure that I have a complete understanding of your question. Are you attempting to use LabVIEW Events (Functions >> Application Control >> Events) with your Advantech DAQ board? This will not be possible. Could you expand upon the functionality you are trying to achieve?
    Spencer S.

  • How to control the tab control using event structure?

    Hi,
    I am using tab control and event structure in the program.
    When i run the application event is not happening for the active page.
    When user switches from active page to the other page then event is taking place for all pages
    So, how to get the event trigger for the active page when the application is started
    For more clarification i am attaching the code "Test Control Tab using Event Structure.vi"
    Attachments:
    Test Control Tab using Event Structure.vi ‏52 KB

    You have a basic misunderstanding of dataflow. Maybe you should start with some tutorials or study some of the examples that ship with LabVIEW.
    The event structure belongs inside the while loop, and not vice versa. RIght now, the event structure only runs exactly once and never again.
    If the stop is pressed first, the VI will stop. Game over.
    If the tab control is changed (from any state to any other state!), the inner loop will spin forever as fast as the CPU allows, either executing one or the other case. It just reads the tab terminal to decide which case to execute. Changing tab never triggers any events. The VI is trapped inside the event until stop is pressed to stop the VI.
    you were closer to a reasonable program in the other thread:
    http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=287905
    Have you tried execution highlighting? Maybe things would become more clear of you do.
    LabVIEW Champion . Do more with less code and in less time .

  • Event.target == null in AIR client

    Hello,
    once again I have a question, and this may very well be a tricky one:
    I have the need to check if a dynamic XFA form has been signed from inside this form. This is quite easy and works perfectly if I just use a button on the form or just about any script event I can think of. It does, however, NOT work if I use the form inside an AIR client which is using a FormBridge construction to communicate with the PDF.
    The problem seems to be that event.target is always null in that case. So what I'm looking for is either an explanation why event.target is null when embedding the form inside AIR or how to check if the form is signed without having to use event.target (or the doc object if you will).
    Can anyone think of anything to achieve this?
    Many thanks,
    Steffen.

    Here is the site: http://coenraets.org/blog/2009/12/air-2-0-web-server-using-the-new-server-socket-api/
    My question is under socketDataHandler() function.
    Thanks.

  • Event.target confusion?

    I'm trying to reusing function by using event.target, but after searching and trying different method online, I found the hardest part to understand is event.target part...
    can anyone please explain to me what is the difference between(the example on right showing where I encounter those code):
    1.event.target
    2.event.target.name
    3.event.currentTarget                             //e.g. event.currentTarget.addChild(myMc);
    4.event.currentTarget.name                    //e.g. var newswf:URLRequest= new URLRequest( event.target.name +".swf");
    5. MovieClip(event.currentTarget)            //e.g. addChild(MovieClip(event.currentTarget));

    I believe that Circle is extending MovieClip so it is MovieClip. The circle is many things, you just have to say the compiler which one you mean
    This is the inheritance of MovieClip:
    MovieClip  Sprite DisplayObjectContainer InteractiveObject DisplayObject EventDispatcher Object
    The main culprit is the event.currentTarget property, which returns the safest option, Object. But it doesn't mean the circle becames only Object and nothing more, it means that the circle is just treated as just-an-object until you explicitly say "treat it as a MovieClip" by casting it as MovieClip: MovieClip(event.currentTarget).

Maybe you are looking for

  • Using substring in the XPATH expression for Receiver Determination

    Hello, I need a little help please.  In my receiver determination, I have a condition and I need to do a "not like" check.   Basically, if the first three positions of the source field does not start with a specific code, then I need to execute the c

  • Java Web Start and MySQL driver

    I am trying to do a simple query on a MySQL database using the JDBC driver from http://www.mysql.com/downloads/api-jdbc-stable.html When I run my app, it works exactly as it should (connects to db, queries, displays in text boxes). When I package it

  • How to make F-02 only can "park" , not "post" .

    Use F-02 to key FI document , how to make it only can "park" , not "post" . I  try to use "PFCG" to find whether any "Authorization object"  to control it ,but i didn't find. anyone can help me ? Thank you ! http://file.itpub.net/forum/201112/07/1518

  • Help !! Lost In user accts

    Hi, I have a Windows XP home edition with 4 accts set on it. Me, wife, daughter (with IPOD, and son (soon to be with IPOD). All accts are set with system admin privilige. So,,,,,,, when ITUNES is downloaded, it is on all accts and can not seemingly b

  • What to do with old remediation patches??

    I had seen postings in the past that if you deleted a ZPM bundle it would remove the patch after the uninstall time passed (default 30days) Is that still the case with 10.3.3?