"selecting" a movieclip at runtime

I've got a number of movieclips on the stage and I have a
slider which I want users to use to change the height and width of
these movieclips. But how do users "select" a movieclip and then
how does the slider know which has been selected so it can adjust
the size of the selected movieclip. Finally, how do users select
another movieclip if they wish to resize that one?
Thanks!
Michael

Several solutions but try using this one:
set a timeline var like 'current_mc'.
In an onRelease event for the mc's the user select, set that
timeline var to 'this' which creates a reference to the clicked mc.
Your function that scales the mc should then use current_mc
to do the scaling on.
var current_mc:MovieClip;
mc1.onRelease=function():Void{
current_mc=this;
}

Similar Messages

  • What's the code for Scaling a MovieClip at Runtime?

    I can't believe how difficult it's been to find an answer for such a simple question.  I found a thread in this forum titled "How to Resize a MovieClip at Runtime?", but the code that was posted as an answer has been removed from the post.  WHY?!?!  Is it a highly guarded secret?!?!
    Anyway...I just want to know how to scale a movieclip at runtime with a drag function...and also while the parent movieclip already has a drag function active.
    Any help would be much appreciated.
    BTW...I've found a cure for death that also instantly makes you the richest person in the world with all the knowlege of the universe...
    It can be found here:

    onMouseUp and onRelease is usually (but not always) the same.
    you can use a scaling factor:
    var scaleFactor:Number = .3;
    mc.onPress=function(){
    resize_mc = this;
    startX =_xmouse;
    startY = _ymouse;
    this.onEnterFrame=resizeF;
    mc.onRelease=function(){
    delete this.onEnterFrame;
    function resizeF():Void{
    resize_mc._width+=(_xmouse-startX)*scaleFactor;
    resize_mc._height+=(_ymouse-startY)*scaleFactor;

  • Nesting dynamically created movieclip at runtime?

    Is it possible to nest a movieclip into another dynamically
    created movieclip at runtime? The commented line of code works, but
    I am trying to nest a movieclip after it is created into
    another.

    you can nest movieclips by using your commented code.
    however, you cannot change a movieclip's parentage after it's
    created.
    you can "fake" a parentage change by creating a movieclip
    with the parentage you want, copying its assets to the newly
    created movieclip with the desired parentage and finally removing
    the original movieclip.

  • Class Inside MovieClip Giving Runtime Error

    Hey guys.
    I'm trying to place an instance of a movieclip (instance
    name: tehMovieClip) from the library within another movieclip
    (instance name: parentMovieClip) on the stage. tehMovieClip, the
    movieclip going inside another movieclip, belongs to a class called
    CollisonDetection (linkage properties, class:CollisonDetection,
    Base Class: flash.display.MovieClip). When I put tehMovieClip
    inside parentMovieClip, I get this runtime error:
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    If I just place tehMovieClip on the stage by itself, it works
    fine but I need it to be inside parentMovieClip. So what should I
    do?
    Just for your information, CollisonDetection extends the
    project's DocumentClass which extends MovieClip.
    Thanks in advanced!

    Thanks for that buddy.
    quote:
    Originally posted by:
    SwapnilVJ
    Is the movie clip your are placing linked from library to a
    class?
    The movieclip in question (the one I am placing inside
    another movieclip) is linked to a class.
    quote:
    Originally posted by:
    SwapnilVJ
    If yes. Is the Class linked to the movieclip have a
    Constructor method with parameters?
    Well this is my current constructor:
    public function CollisonDetection() {
    playerRefFromCollisonDetection.x = 600;
    Now that you've said that, I deleted that middle line and it
    seemed to work
    quote:
    Originally posted by:
    SwapnilVJ
    If Yes. you found the problem.
    And solution will be to update the class' constructor to have
    no parameters.
    Thanks buddy, but what if I need to have statements inside
    the constructor such as triggering methods/functions inside the
    class?

  • Scripting MovieClips at runtime

    It's it possible to create an empty clip and then add frames,
    frame labels and scripting to it at runtime?

    add frames and frame labels, i'm not sure... but scripting is
    possible and drawing the first frame
    here's an example (in code).
    It creates a movieclip with a name called blahblah and random
    numbers after it. Since we don't know what the number is, (and
    usually when you create a movieclip that's the case) we represent
    the newly made item with the variable blah.
    Then it draws a 10x10 box (with 0,0 as the center). It moves
    it to the center of the screen (for the heck of it).
    Then the onEnterFrame = function() is how you script with it.
    Saying "with" makes it use the local variables as blah. In
    blah, it makes the _x and _y to the mouse.
    Hope this helps.

  • Change selection screen language in runtime

    Hello Experts,
    I would like to ask for your help in the following problem. I have to change a report's selection screen language to English ifthe user logs on a particular language. Is that possible anyway in run time? I've already tried to do it with the SET LOCALE LANGUAGE at the INITIALIZATION event, but without any success.
    Thank you in advance for any piece of tips!

    Hi,
    Those selection screen elements will get loaded before initialization event itself.
    if you want to change the language then change the language in LOAD-OF-PROGRAM event like this..
    load-of-program.
    set locale language 'E' .  " --> Language Should be single character only
    Thanks:
    RK

  • Programmatically select a sketcher at runtime

    Hi !!
    We have two editor named MDL editor and ISIS editor installed in the system. Actually, I have to open the editor programatically. We have developed a eclipse plug-in for that and that is working fine. The issue is when I selected the ISIS editor in eclipse environment and make the call, then every time MDL editor is get opened. How can I select the editor at run time. If you guys have any idea then please do help me.

    Pop up a dialog and ask which the user wants...
    or you are going to have to choose the default one that you want used and search the system to see if it is installed.

  • Resize a movieclip at runtime

    I'd like users to be able to drag out a shape from the side
    of the stage (say a square) and then resize it on the stage. I
    think I've seen this Flash functionality somewhere on the web, but
    I can't figure out what the code would be for this. Can anyone
    help?
    Thanks,
    Michael;

    I think I've got the problem solved, but can I follow up on
    one thing you mention below? It has to do with the parent/child
    relationship and the startDrag action. I was under the impression
    that if I put a movieclip inside of another movieclip and then
    apply a drag action to the parent movieclip, then there was no way
    to access the child movieclip. For example, I put a small textInput
    component inside of a larger movieclip and then I put a drag action
    on the movieclip. I wanted users to be able to type in some text
    into the middle of the movieclip and then move the moviecip around
    if they wanted to. However, as soon as I put the drag action on my
    parent movieclip, the inputText component could no longer be used -
    the "hand" appeared over whole movieclip so users could no longer
    type anything into the inputText area. Is there any way to do what
    I want to do here?
    Appreciate your help!
    Michael

  • Reply to RBFINK about Selecting a Report at Runtime in VB6

    Post Author: David B
    CA Forum: General
    I got the following private message, and the reply link refuses to lead back to a valid post:You have received a new Private Message from RBFINKSubject: ActiveX Control PostWas wondering if you ever found a solution for creating a crystal report object from a file path in VB 6. I am having the exact same problem as what you have posted and have not found a solution, yet.  Thanks.Click on the link below to reply to the private message.http://technicalsupport.businessobjects.com/cs/forums/thread/1546.aspx---I have your answer, but just as of today, so your timing is great.  The following code does what both of us want to have happen.  You'll need the following 4 references set for your version of CR (xx.x = 9, 10, 11, 11.5)Crystal ActiveX Report Viewer Library xx.xCrystal Reports ActiveX Designer Design and RunTime Library xx.xCrystal Reports ActiveX Designer Run Time Library xx.xCrystal ActiveX Report Viewer Library xx.x ---Also you'll need your ReportViewer component set so that you can place the viewer control onto the form.When you have all that, then the following lines of VB6 code will do what you want:    Dim crApplication As New CRAXDRT.Application    Dim crReport As CRAXDRT.Report    Set crReport = crApplication.OpenReport("report file path")    With crvReport        .ReportSource = crReport        .ViewReport    End With

    Post Author: RBFINK
    CA Forum: General
      Dim MyCrystal As CRAXDRT.Application  Dim MyReport As CRAXDRT.report  Set MyCrystal = New CRAXDRT.Application  Set MyReport = MyCrystal.OpenReport(strMyReportPath)
      Dim crxTable As CRAXDRT.DatabaseTable  For Each crxTable In MyReport.Database.Tables    With crxTable.ConnectionProperties 'OLEDB Connection info...      .Item("user ID") = strMyUserName      .Item("Password") = strMyPassword      .Item("Data Source") = strMyServer      .Item("Initial Catalog") = strMyDatabase    End With  Next crxTable      With MyCrystalViewer    .ReportSource = MyReport    .ViewReport  End With

  • Select location of cvi runtime

    Hi all!
    I'm pretty sure that on former versions of cvi there was the possibility to choose if the runtime and other depending dll's are installed in the application directory or in the system directory.
    Where is this option gone in cvi 2013?
    Best regards,
    Thomas

    Hi,
    When you install multiple versions of LabWindows/CVI, only one Run Time Engine (RTE) is used. There is some information in this KnowledgeBase article. The RTE is backwards compatible.
    Are you looking for this option when you are using CVI development environment or for building applications?
    Evan S.
    National Instruments

  • ComboBox problems when in a MovieClip loaded at runtime

    Hello,
    I hope someone out there can help me with this problem: I
    have a ScrollPane that contains a MovieClip that to which I attach
    several other MovieClips at runtime in response to user inputs
    using attachMoveClip() (both MCs are in my library and set to
    export for actionscrip in first frame). Each of those MovieClips
    contains a ComboBox.
    At runtime, I attach the MovieClip containing the ComboBox,
    then I set the dataProvider property for the ComboBox to a list
    (Array) of data/label value pairs. I then try to set the text
    property of the ComboBox to a "Please select a value" message and
    then I add a couple of listeners.
    Setting the dataProvider property sort of works: the ComboBox
    displays the proper dropdown list when clicked, but nothing happens
    when I select an item from the dropdown list - i.e., the selected
    value doesn't display in the ComboBox's TextField.
    Setting the text property doesn't seem to work: the value
    doesn't display in the ComboBox's TextField, but oddly, if I trace
    the ComboBox's text property, it outputs the correct message.
    Also, none of the event handlers work at all.
    I tried all of the same code on a ComboBox that isn't created
    dynamically, and it all works.
    Here's the code. The first set of code is the part I need to
    get working. It sets up the ComboBox after the MovieClip it is
    contained in is attached to the parent MovieClip. The second set of
    code was my test code to see if this worked on a ComboBox that
    isn't created at runtime. It all works properly.

    Most likely the Combobox isn't fully loaded yet. In your code
    check if a property of the cb is undefined using an interval and
    proceed with the code when the property is defined.

  • How to select  BAPI at runtime ?

    Hi
    I have a drop down list box with three options.After selecting a option a particulaer BAPI has to be called which will display some information on the screen.
    So how do a select the BAPI at runtime or I have to link previously all the 3 BAPI's at design time and create 3 views and depending on the option selected a particular view will be displayed.
    Please suggest
    Regards
    Ananda.

    Hi Ananda,
    Create three tables and bind them to the corresponding output nodes of the BAPI. In the 'onSelect' event handler of the dropdown, write your own logic for executing one of the three BAPIs depending on the input. At the same time, make only the required table as visible (using attributes of type WDVisibility bound to the 'visible' property of the tables).
    Regards,
    Shyam.

  • Multiple Animations for a single MovieClip sprite

    Ok, after hours of exhausting searching, and having to learn how to animate a simple sprite for the 100th time, I hope I might found I more specific, and better explained answer to my problem.
    I'm trying to make a flash game, of course, and I want my main Player sprite to be able to play multiple animations based on specific input. So, a running right animation, a running left animation, a jump animation, and an attack animation.
    At the moment, the most I can seem to achieve is to create a single timeline, with a default frame in the exact middle. Then when player holds left, it plays the previous frame, or scrolls backwards through the timeline. When the Right key is held, it plays forward from the default middle.
    It's ugly and extremely limited. I've tried using the gotoAndStop() and gotoAndPlay() methods, but because the statement checking for the key being pressed is constantly being checked, it will stay on the frame chosen for those methods, rather than move forward along the time line.
    I would greatly appreciate a better method for this, or a more specific tutorial to achieve the goal i'm looking for.
    I've seen mention of the attachMovie() method, but I can not find an understandable explanation of how to properly use it in the way I desire.
    essentially, the sprite will have the default standing frame while no keys are pressed. Then, if the right key is down, it plays the running right animation. When the left key is down, it plays the running left animation. When the jump key is pressed, it plays the jump animation. And when the attack key is pressed, it plays the attack animation.
    I hope that's enough information and that it's understandable, if not, let me know what more you need to know and I'll do my best to explain it more.

    You can do this a number of ways but I will try to explain the what I think is the easiest.
    Step 1
    Draw a box on the stage
    Step 2
    convert this into a movieclip (F8), name this myCharacter (or anything you want really), then press ok. Now select this movieClip and in the properties dialogue box, type "box", again, without the quotes. Then press enter.
    Step 3
    Double click this new movieClip (this should take you into this movieClip timeline)
    Step 4
    Now press F6, 3 times. This wil give you 3 additional key frames on this timeline. You should now have 4 key frames.
    |Step 5
    Select key frame 1 on this timeline and press F8. Type into the diag box "standing", without the quotes. Then select the Movie Clip radio button, if it is not already selected.
    Step 6
    Step 12
    Make sure  your library is in view, if not Ctrl+L. You should see the movement clips you created, running_right, running_left, etc. Double Click any one of these and add the animation your want in these movs.
    There we go, simples.....Test you animation and see how you are doing.
    Select key frame 2 on this timeline and press F8. Type into the diag box "running_right", without the quotes. Then select the Movie Clip radio button, if it is not already selected.
    Step 7
    Select key frame 3 on this timeline and press F8. Type into the diag box "running_left", without the quotes. Then select the Movie Clip radio button, if it is not already selected.
    Step 8
    Select key frame 4 on this timeline and press F8. Type into the diag box "jumping", without the quotes. Then select the Movie Clip radio button, if it is not already selected.
    Great, once you have done this, these new movieClips should now have appeared in your library (press Ctrl+L if you cannot see your library)
    Ok then you have just created your movement MovieClip. You now need to get back to the main timeline. You can just keep on clicking the stage to get back to this location. Once there you need to select the box you have just created and name this "box" for the time being.
    Ok then a little bit of programming now.
    Step 9Create a new layer in the timeline and name it scripts.
    Step 10Then select this layer and press F9 on your keyboard. THis should bring up the scripting pane for this frame.
    Step 11Type in the following code
    box.stop();// when you run this animation, this command will stop your box from doing anything
    var keyBoardListener:Object = new Object();// Creates a new Object for the keyboard presses
    keyBoardListener.onKeyDown = function() {
    if (Key.isDown(Key.LEFT)) {// runnning LEFT action
      _root.box.gotoAndStop(3);// Frame where the running right animation is
    } else if (Key.isDown(Key.RIGHT)) {// running RIGHT action
      _root.box.gotoAndStop(2);// Frame where the running right animation is
    } else if (Key.isDown(Key.UP)) {// JUMPING action
      _root.box.gotoAndStop(4);// Frame where the JUMPING animation is
    keyBoardListener.onKeyUp = function() {
    _root.box.gotoAndStop(1);// When the keys are released, this action takes your animation back to frame 1, where your character is just standing still.
    Key.addListener(keyBoardListener);// this assigns the listener to your key press detection Object.
    Step 12
    Edit the action movs within your library by double clicking each one and adding movement to each. Then test your animation.

  • How can I get selection screen values from outside of program?

    Hi. all.
    Now. I'm developing moritoring systems and I have problems. for getting selection screen values in runtime. Is there any function, methods or structure to know this?
    I'd like to get selection screen values while several programs working in runtime and update these values to table to show current system's status and input values for users in real time.
    For example.
    Now. 3 PGMs are working on systems.
    each PGM is ZAAA01, ZAAA02, ZAAA03.
    and ZAAA01 needs input parameter P01, ZAAA02 needs input parameter P02, ZAAA03 needs input parameter P03.
    In this case, I have to know values of P01, P02 and P03.
    The mornitoring systems will show current working status of PGMs(ZAAA01~03)' and these PGMs' input values.
    As fas as I know, the structure 'SCREEN' can be used in each PGM for runtime. Is there any SAP system structure or something else for this purpose?
    I hope your hopeful repsponse.
    Thanks.

    Umm..I need to explain more about this.
    of course I know  SET, GET PARAMETERS.
    But I'd like to minimize coding for each PGM level.
    I have over hundreds PGMs and I have to develop the PGM(including tables and structures) that mornitor
    all of those PGMs on a report in real-time.
    This PGM is kind of  Process Manager.
    First I should know dialogue job PGM and background job that pass parameters using SAP(ABAP) Memory.
    And then I have to update those PGMs' input values via screens into tables in real-time.
    So, I couldn't use SET,GET PARAMETERS for this PGM.
    I want to know methods that can be used for getting information about runtime PGMs' selection screen field values in SAP systems wide.
    Please help me some one knows this.

  • How to get the specific name of the workset which is currently selected by the user in sap portal 7.0

    Dear Expert,
    I have one requirement like to read the selected workset name in portal by the current user.I have read two documents regarding how to retrieve the PCD contents (iViews, Pages, Worksets and Roles) and its properties like Created by, Changed by, Last changed by and others using PCD API.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/6112ecb7-0a01-0010-ef90-941c70c9e401?overridelayout=true
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/508baf88-9335-2d10-efa6-c6ad61e5fc4b?quicklink=index&overridelayout=true
    But I am not able to understand how to get the specific name of the workset which is currently selected by the user.Can you please help me.
    I am using portal 7.0.
    Thanks & Regards,
    Patralekha

    Hi Expert,
    I found that we can use Interface INavigationHelperService to read Portal Role selected by user at runtime from http://scn.sap.com/thread/52194
    But this class is available in SAP NetWeaver 7.30 Enterprise Portal .
    But in SAP NetWeaver 7.0 Enterprise Portal that interface is not available.
    INavigationService is available there.
    But didn't get any proper discussion on this interface for the same requirement.
    Can you please help me.
    Thanks & Regards,
    Patralekha

Maybe you are looking for

  • Discount in PO Price

    hi, if i input discount (header and item level in configuration) in header level, the net price will be deduced as discount involve. Is it possible the item net price not change even discount had input in header level. thanks

  • Deltas are not pick up by the data source

    Hi,    From one weak onwards my data source is not pick any deltas today i found that the luw's are struck into LBWQ.I can see the luw's in lbwq .In rsa7 there is no luw'sie It shows 0.My data source 2lis_02_scl. The V3 job compleated success fully e

  • All my music in my library say unknown

    I just installed windows 8 then installed iTunes and authorized my pc, and every thing looks good. Then I try to sync my iPod and all the names and songs say unknown. So how can I get back the names?

  • 2 parameters

    Hi, How to design a selection screen with 2 parameters on the same line, like date1:                and date2:                 . Thanks.

  • Having trouble selecting text in Illustrator CS5

    Hi! I've a little problem, when I select text by double click it do not show me the black selection...I don't know why? Any ideas? Thx Ciao!