473,700 Members | 3,047 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 5346
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
4430
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
1624
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
4496
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
2375
by: nagraj | last post by:
hi i have a problem in flash .how to call a movieclip to another movieclip give _root
1
9374
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
4321
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
3245
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
2333
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
3756
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
8639
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
9059
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8957
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
8912
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
7795
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
6556
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
5897
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2379
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2021
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.