473,748 Members | 2,563 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

reference movieClip inside another movieClip

108 New Member
I have my general movie clip called myscene_mc .
Inside it I've placed other 2 movie clips called man_mc and insect_mc...
Now,my man_mc contains another movieclip which is empty and i call it forward_mc...

Now,can I use forward_mc and insect_mc to check if they are intersecting using something like that ::

trace(man_mc. forward_mc.hitT est(insect_mc)

I hv tried this bt althougn they are intersecting,th e output is false

How can I check when the 2 movie are intersecting??
Any help will be kindly appreciated ..Thanks
Jan 1 '10 #1
2 5351
iamfletch
18 New Member
i dont know what exactly your asking here. assuming you have a set up like the following:
Expand|Select|Wrap|Line Numbers
  1. var myscene_mc = new myscene_();
  2. var man_mc  = new man_();
  3. var insect_mc = new insect_();
  4. var forward_mc = new MovieClip();
  5.  
  6. addChild(myscene_mc)
  7. myscene_mc.addChild(insect_mc);
  8. myscene_mc.addChild(man_mc);
  9. man_mc .addChild(forward_mc);
  10.  
then you can access them from here eg
Expand|Select|Wrap|Line Numbers
  1. //inside insect_mc
  2. function test (var)
  3. {
  4.    trace (var)
  5. }
  6.  
  7. // must be coded here (for the refference to insect_mc to be avalable)
  8. man_mc.test2 = function()
  9. {
  10.    insect_mc('hi')
  11. }
  12.  
I havent debugged this, it should work
Jan 20 '10 #2
iamfletch
18 New Member
ok sorry about my previous reply, i want to delete it to be honest. not many people will be able to help here as hitTest is now obsolete(its as2 and most people are as3 now). i downgraded for you and the problem has a simple solution.

Expand|Select|Wrap|Line Numbers
  1. trace(man_mc.forward_mc.hitTest(insect_mc));
  2. // change to 
  3. trace(insect_mc.hitTest(man_mc.forward_mc)
  4.  
Jan 21 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
4432
by: veenathi | last post by:
i am trying to write code for coping a certain portion of movieclip into another movieclip. for that i draw big stage movieclip. (stage_mc).Then i draw small rectangle movieclips on the stage movieclip. (rect_mc) Now what i want, is that the area of the stage_mc that the rect_mc is drawn on, should be made into another movieclip. So that portion of the stage_mc which had been selected by the rect_mc, becomes a new movieclip newMC_mc. ...
1
1627
by: molle | last post by:
Hi! I know there is a way to control a flashmovie using javascript, but I wonder if there is a way to access a movieclip instance in a flashmovie using javascript. I have a site with a flashmovie embedded then I have a javascript menu that enables the user to change the backgroundcolor of the site. The backgroundcolor of both the html-page and the flashmovie needs to be changed. The background of the html-page is easily changed with...
2
4500
sumaiya
by: sumaiya | last post by:
I know how to load dynamic images in a movieclip sPhoto.loadMovie('http://localhost/1.jpg'); I have two movieclips "mcMain" and "mcArticle" mcMain ---- mcArticle --- mcPhoto mcPhoto is inside mcArticle and is suppose load an image dynamicaly I am using the above code but it does not work. Please Help. My code is given below onClipEvent(load) {
1
2377
by: nagraj | last post by:
hi i have a problem in flash .how to call a movieclip to another movieclip give _root
1
9377
by: molle | last post by:
Hi, this is perhaps a common question, but everywhere I just find how to load external images into a movieclip. I have images in my Library that I want to load into a movieclip, so I used attachMovie like this: mc.attachMovie("imagename"); where imagename is the Linkage identifier, but this doesn't work, so I wonder what I am doing wrong?
1
4322
by: logicgates | last post by:
Hello My name is Saqib, Im making a Flash map. I need to call a movie clip from the menu of the cities, that is an external file an swf. when i click on the country in the menu, the country on the map in the other swf file should show some transion like Blinking. I formed a movieclip of such transion in the map file. Now how can i call that movie clip from the menu swf file. i want to add that code in the body of on(release) function against...
1
3248
by: Aniket Khedkar | last post by:
Hi, I have dynamically created movieclips using actionscript in flash.That is using my_mc.createEmptyMovieClip("my_mc"+i,i); and i have to get link on movieclip which consists of images that r placed on this movie clip( "my_mc"+i,i) ...there r 16 images and have to get 16 different link.1link for each image.
0
2338
by: sethupnr | last post by:
hi, how can i load a gif image into a movieclip at runtime . I used loadMovie() but it only works with JPEG. thanks
1
3761
by: ZenQuickZen | last post by:
This is a script for a character that walks in 4 directions. That works fine. I have also added other random movieclip animations for other keystrokes. I want a movie clip to play through when a key is pressed. Right now the movieclip only plays while the key is being held. How do I get it to continue to play even if the key is released? I am not sure if I need to add something to my action script or change it entirely. Here is my script: ...
0
8832
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9562
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9333
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8255
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.