[ H3LP ] Find object?
A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: [ H3LP ] Find object?

  1. #1
    I'm not Crazy :D
    Join Date
    Nov 2015
    Location
    Brazil [<o>]
    Posts
    84

    Question [ H3LP ] Find object?

    Hello, how I can check if a MovieClip exists in another?

    Basically I need to check if a "SolidPoint" (represented by a red X) is "inside" of the object clicked by the mouse and block the player's movement if true.

    Code:
    function CBaseUI_MouseDown(e:MouseEvent):void
    {
    	// If find SolidPoint in e.target, do not move the player
    	_player.moveTo(mouseX, mouseY);
    }



  2. #2
    Senior Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    831
    If you are tracking it through the mouse event I use trace(e.target.name) or trace(e.target.parent.name) or event if you are wanting to look through all of the movieclips inside of it you can check trace(e.target.numChildren); to find all itsclips and check through each name like
    trace(e.target.getChildAt(0).name)

    trace(e.target.getChildAt(1).name)

  3. #3
    I'm not Crazy :D
    Join Date
    Nov 2015
    Location
    Brazil [<o>]
    Posts
    84
    But, name retrieves the instance of the object and not the class, so basically I would have to instantiate the object manually, correct?

    I will do some tests with myself.

  4. #4
    Senior Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    831
    MovieClip(e.target.getChildAt(0)).gotoAndStop(2)

  5. #5
    I'm not Crazy :D
    Join Date
    Nov 2015
    Location
    Brazil [<o>]
    Posts
    84
    Well, let's just say that in the end, my idea didn't work out so well. I'm trying to create a "point and click" RPG, but the logic to plot a valid path (stopping the movement or circumventing when there is an obstacle) is difficult. Maybe you have a suggestion?

  6. #6
    Senior Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    831
    If this is a tile based game, you can use a* path finder which I have, but you should have some bytecode based map to read off of as well, is that a 3d game? looks like an image of some walls ready for rotationY to be used. And lol I hated when I got the Spanish flash, I posted in as3 section my adobe account so you can download adobe animate which has as3

  7. #7
    I'm not Crazy :D
    Join Date
    Nov 2015
    Location
    Brazil [<o>]
    Posts
    84
    Actually it's not a fps haha, despite the low level graphic, I'm thinking of developing a game based on Diablo 1 (PS1) and hack slash crawl (flash). About the adobe animate, ok, I will try to search!

  8. #8
    Senior Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    831
    Oh could the iso Ive been writing to that?

    In as2 that's way easier, but this one I wrote in as3 there is no room for error I use a depth method for the tiles called core 2 quad because you handle the core tiles separate from the 4 sides.


  9. #9
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,721
    Hi

    All very good and well alloy, but what on earth has that last post got to do with the original post and how is it going to help them.

    I smell strangeness going on here.

  10. #10
    Senior Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    831
    Diablo 1 looks like an iso scroller isn't that what he wants as the end result anyways

  11. #11
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,721
    Hi

    Sometimes you make no sense and are just trying to advertise yourself and your stuff.

    I hope the op can get their answer from your videos.

    X

  12. #12
    Senior Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    831
    ok fine froobbeard

  13. #13
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,721
    Hi

    Keep up the good solid helping work alloy as we all know you do

    X

  14. #14
    I'm not Crazy :D
    Join Date
    Nov 2015
    Location
    Brazil [<o>]
    Posts
    84
    I'm going to run some tests and then I'll tell you what I got.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center

Poll by Flashkit.com