How to communicate a button to a movie_clip inside the component UiLoader using AS3?

Hi, I do a flash app to test various paintings, for a company.


I have a movie clip on stage with buttons on the left side and a uiloader side that loads an external swf file on button (thumb_01) click-target. In main movie clip, there are two buttons. 1 trigger a function to choose a wall and a 2nd trigger a function to select the roof. External file swf (movie_01.swf) has two clips 1 is a wall (mask_01) and the 2nd is roof (mask_02). Now the problem is I want to click a button to select the wall inside the external swf file to change its color. I am sure that the problem is in the path by which I try to choose a film of wall that is inside UiLoader. Can someone tell me what will be the path to trigger a function to a clip inside Uiloader?



Here is my code for the button to select a wall or roof .




import flash.events.MouseEvent;

Import fl.motion.MotionEvent;



var targetObj:Object;


selectWall_btn.addEventListener(MouseE... selectWall);


function selectWall(evt:MouseEvent):void {}

targetObj = uiloader.movie_01.mask_01; <-I think the problem is in this way...

trace ("wall is selected!');


}





Here's the code for uiloader =...



Import fl.containers.UILoader;



Object (this). slider_mc.thumb_01.addEve,... loadMovie_01);


function loadMovie_01(evt:MouseEvent):void {}


trace ("film is loading!");


var uiLoader:UILoader = new UILoader();

uiLoader.source = ' movies/movie_01.swf ";

uiLoader.scaleContent = false;

uiLoader.x = 291;

uiLoader.y = 19;

addChild (uiLoader);




uiLoader.addEventListener(Event.COMPLE... completeHandler);

function completeHandler(event:Event) {}

trace ("number of bytes loaded:" + uiLoader.bytesLoaded);

}

}

Error is the following...

Scene 1, Layer 'Forth', frame 1, line 431120: access of undefined property uiLoader.



Can someone help me?

Part of the problem is due to declare the uiLoader inside a function.  When you do that limit its scope within this function.  You must declare outside any function if you need to access it in more than one function.

import flash.events.MouseEvent;

Import fl.motion.MotionEvent;

var uiLoader:UILoader;

var targetObj:Object;

Other issues I consider the line that you point.  This is not spelling the name, with a small 'l '. Also, if you want to target that contains the UILoader, you should target its 'content' property, as in...

targetObj = uiLoader.content.mask_01

Tags: Adobe Animate

Similar Questions

  • How to create a button to download files in the form?

    How to create a button to download files in the form?

    Hello

    Please refer to the link below with a similar discussion.

    Download file button

    Kind regards

    Vivek

  • How can I transfer pictures from my computer to the iphone 5 using icloud

    How can I transfer pictures from my computer to the iphone 5 using icloud

    Normally, you do not use iCloud for this, you use iTunes, as shown below, but you can use iCloud photo library if that's your preference.

    Keep your photos safely stored and updated on all your devices - Apple Support

  • How to view NTUSER. DAT file as to the registry without using it?

    How to view NTUSER. DAT file as to the registry without using it?

    The file is from a different Windows instalation!
    I have Win 7 but it comes from my old Windows xp.

    Hi Leonnis,

    There are many ways to read the registry file without using regedit.
    Some ways:
    RegLookup: RegLookup project is dedicated to the direct analysis of Windows NT registry files. RegLookup is distributed under the GNU GPL license and is implemented in ANSI C. RegLookup provides a C API, a Python module and command line tools to access registry data structures.
    Download here: http://projects.sentinelchicken.org/reglookup/
    RegViewer: Is GTK 2.2 based registry Windows GUI file browser. It is platform-independent for the review of the files of Windows registry from any platform. Particularly useful in forensics files Windows of * nix systems.
    Download here: http://regviewer.sourceforge.net

    RegRipper:

    RegRipper is an application of forensics software open source developed by Harlan Carvey. RegRipper, written in Perl, is a tool for extracting data from Windows registry.
    Download here: http://regviewer.sourceforge.net
    KRegedit:
    kregedit is a KDE utility for the visualization of the native Windows registry files. It is similar to the regedt32 utility that is found on most Windows platforms. Only the format of the NT (NT4/2000/XP) registry is supported.
    Paulo Breim
    Centro Brasileiro Pericia

    Help, please!

  • How to create a button that is persistent on the top of the Gallery HTML page

    Hello

    My InDesign folio, I have an article with photo gallery full HTML page. The photo grid occupies the full screen. I want to create a button that is persistent on top of this gallery, which the user can type to go to the main Menu page. This button is always visible in one place, even as the user scrolls up and down the gallery. I tried to create it on the top layer and the upper layer of the page master, but the button disapperas loading the HTML gallery.
    If the user does not see any button to navigate through the Gallery to another article.

    Any ideas how to create persistent button?

    Thanks in advance.

    -MP

    Why not do things just like an HTML article? You do it in the Muse.

  • How approve/reject/etc buttons can be removed from the notification of workflow

    How can I remove buttons approve/reject/etc email vacation workflow approval notice to the Manager.

    Scenario-
    Employee submits to holiday on self-service. The Manager receives notification by e-mail for approval. On this email notification, he can see buttons to answer like "Approve", "Reject", "Request for information".

    The requirement is-
    Without changing the rest of the behavior, how the buttons be deleted or hidden from the notification email. A new message must also be updated to mention that managers had to connect self-service to approve public holidays.

    Thank you, Hussein!

  • How to activate a button in Captivate 5 - at the end of the bearings?

    Hello - I am working on a project with Cap 5 that involves an image with of 4 sidelet reversal.

    I have 2 buttons that control the navigation that are labeled (previous and next).

    The first tip action triggers on enter.

    It is a standard action that disables my next button and hides all my text captions that will be displayed when a user rolls over the image to see a hotspot region.

    What I want to do.

    I need to add a number to a variable so that once that the user hovers over all 4 sidelets... in any combination/order they want, they then unlock the next button.

    I have the following job

    Sidelets turning points are defined for each zone to show each sample of appropriate below text caption.

    See the Text_Caption_1 / / will display the text on a rolling caption.

    Expression Slice_count = Slice_Count + 1 / / I'm not sure if this is the right way to increment my Slice_count VAR or not?

    I know not how to assess when the Slice_Count VAR reached a literal = 4, an increment to each each sidelet turnover, with only 4, at some point, once they are all renewed I should have something to evaluate?

    Examples of how rate and add increments of objects with the intent to activate a button?

    Appreciated the gift

    as we lilybri, you might have a problem where could someone flipping a hotspot twice, get a + 2 and the next button comes early.

    I did similar in the past in Cp4, but I can't find my example at the moment.  If I remember, I put a variable for each hotspot.  HotSpot1, hotspot2, hotspot3, etc. and set the button to be hidden.

    When rolledover, I got a conditional action that checked for the variable to zero and if zero set to 1 (if hotspot1 = 0, then assign hotspot1 = 1).  the conditional action (on each hotspot) checked every variable, and if each variable is equal to 1 (if hotspot1 = 1 AND hotspot2 = 1 AND hotspot3 = 1), the action executed a 'show' button (and then see the button_21).

    Sorry I don't have a screenshot of the example, but I hope the above makes sense and you can adapt it.

  • How to activate a button only when an item of component tilelist is selected

    Simple question, but it seems quite difficult for me. How to activate a button only when an item in a tilelist currently selected?

    For example, lets say if I have a button named button1, which is disabled by default and a tilelist component called tilelist1 that I should add in brackets the following (the enabled property of the button) code to make sure that the button is only enabled when an item in the tilelist component is currently selected but disabled when no item is selected :-

    enabled = "{}".

    Enabled = "{tilelist1. SelectedItem} ".

    that should do it, it is making an implicit comparison with null (tilelist1.selectedItem == null) which will result in a Boolean value.

    SelectedItem is null when nothing is selected, non-null when something is.

  • How to create a play button to the video clip using AS3

    Hello.

    This new bit and searched the forums adobe and google. I am trying to create a button that will play an any MovieClip.

    I have a clip that I imported into its own layer of rebar (layer1) 1.  I gave the MovieClip an instance name of foundationMovie.

    I created a button and that on its own layer (Layer2) above layer1, is also in the picture 1.

    I added a

    Stop (); action of layer2

    The video is not set to AutoPlay.

    I want the video to start playing when the viewer clicks the button.  I know I have to put some sort of event using AS3 listener in my calendar somewhere.

    I found a code and I tried to work with her.  I'm sure I've mutilated it beyond usability, but it's what I have.

    Stop ();

    player.addEventListener (MouseEvent.CLICK, play);

    function play(event:MouseEvent)

    {

    gotoAndPlay ("foundationMovie");

    }

    If someone could point me in the right direction or help me with my code I would really appreciate it.  Thank you.

    If you use the FLVPlayback instance it should be on your scene, or you should have the code added to the scene. If you use the FLVPlayback instance, you don't need to import the video file, you have to have the component dynamically load by assigning the file to its source property.

    That said, the code that I showed earlier would continue to operate if the component FLVPlayback instance name of the instance 'foundationMovie '.  It's because the component has a play() and stop() supporting method.  What you need to do probably, is looking for the FLVPlayback class in the help documentation of Flash to see all that is avialable for her regarding the properties, methods and events.  You will probably find there examples as well to help you configure things.

  • How can I have 2 email accounts open at the same time using the apple mail icon?

    How to open 2 e-mail accounts at the same time?

    Hello carroll12,

    Thank you for using communities of Apple Support.

    I see that you do not want to open two e-mail accounts at the same time using the Mail application. I understand perfectly. I have multiple e-mail accounts set up in my Mail application. I'm happy to help you with this.

    You can have more than one e-mail account set up in the Mail application. The first time you open Mail, it may prompt you to add an e-mail account (if you have not already done). Select an account type, and then enter your account information. To add another account, choose Mail > add an account, select an account type, and then enter your account information. Make sure that the Mail check box is selected for the account.

    If you have already both set in place, and I just want to be able to view both on the screen at the same time, open Mail, and then click file at the top.  From there, select the option for the new window of the observer.  This will open a new window where you can see each of the individual mailboxes on the same screen.

    Have an amazing day!

  • extend ListField, how to get a valid result of getSelectedIndex inside the method object?

    Hi all

    I have replace the method object to extend ListField to create my own color ListField.

    I need to avoid the double drawRow between the method object

    and the drawFocus() method.

    inside the method object, I always get the 'bad' selectedIndex (previous)

    (or rectangular previous on getFocusRect()).

    my questions are:

    1. how to get current selectedIndex (or FocusRect) inside the method object when we extend ListField?

    2. is there any other method called before object, the method which returns SelectedIndex valid?

    3. how to avoid the double drawing between object and drawFocus()?

    Thank you.

    If everything you do is add your own color, and then you can do this by using a fillRect in the drawListRow method.  In there.  I have the code that did this, but only for lines not targeted, as it detects with:

    If (listField.getSelectedIndex ()! = index) {}

    //

    }

  • How can I email PDF as an attachment inside the Muse?

    I want to include a form to fill out on a page of Muse. Once the person fills in, how can I have them send the filled form to inside the Muse page?

    I would advise against trying to send the PDF by email. It is generally improper to be many, many reasons. For HTML forms, an experienced web developer needs to rewrite the end server (ASP, CGI, PHP,...). PDF forms are not simple.

    I would use a widget in muse. Go to your menu on the right Muse, select widget library, select Forms.

    from there, you can create any field and insert your own content. This will allow you to send content to your e-mail address, once completed by the end-user.

    Concerning

    Shane

  • URGENT: How to identify Parent movie when we're inside the COMPLETE event

    Hi all
    I have try it for 4 days for a Solution, I don't know how to solve this problem.
    Well, I'll explain the Situation. I'm list creation of thumbnail using AS3 coding. Everything will work well.
    After the loading of the thumbnail, I want to resize the thumbnail to fit the size of the thumbnail. To set the exact size that I have to get the sample size movie that is placed inside the MC sticker, I can't able to get the name of the Instance. Here with, I have attached my sample Code. Please help me on this

    Try this code in onThumbLoaded:

  • How we communicate between 2 Mobile Applications developed in the MAF

    We have a scenario in which we want to launch another mobile app with some input parameters. Please let me know a way to do it. Can be done by using the scope Managed beans?

    Hello

    Yo taste which is documented here?

    4 definition of a Mobile Application (version 2.0.0.0.0)

    Frank

  • How to access select a value choice presents inside the query.

    Hi Experts ADF,

    JDEV 12.1.3.0

    I have a query Panel, which contains a selectonechoice in field.i.e of search category drop down.

    Now when you click on search how do I need to capture the value drop-down list. Based on the drop in value, I want to disable the button in the table that are in panelCollection

    Thank you

    Roy

    Hello

    you need to do your own processQuery of the af.query method

    EDIT:

    I forgot to add the link Ashish Awasthi (Jdev/ADF) Blog: the substitution of the listener default query, validation in the field of af: query-Oracle ADF

    Kind regards

    Ruben,

Maybe you are looking for