Solved

attachMovie works only if used with _root.

Posted on 2003-12-01
3
181 Views
Last Modified: 2010-04-03
Hi everybody,

I have a little annoying problem. I'm trying to dynamically attach a couple of movieclips to an existing movieclip in order to mask them. The problem is that it doesn't work.

Here is the code :

myPicture.prototype = new MovieClip();
Object.registerClass("pictureSymbol", myPicture);
for (i=0; i < BaseNode.childNodes.length; i++) {
      picID = "picture" + i;
      scroller.attachMovie("pictureSymbol", picID, i+80);
      ThisNode = BaseNode.childNodes[i];
      tempItem = eval(picID);
      tempItem.setPosition(startX, startPos);            
      startPos += tempItem.getHeight() + incY;                  
}
scroller.setMask(mask);

"pictureSymbol" was previously defined and is set to "export in first frame".

So the problem is at line 5.  If I write scroller.attachMovie.... it doesn't work, but if i write _root.attachMovie... it works. So i can't mask the scroller.

Any help would be appreciate..... thanks
0
Comment
Question by:p00pstar
3 Comments
 
LVL 27

Accepted Solution

by:
negatyve earned 125 total points
Comment Utility
=====================================
myPicture.prototype = new MovieClip();
Object.registerClass("pictureSymbol", myPicture);
for (i=0; i < BaseNode.childNodes.length; i++) {
    picID = "picture" + i;
    scroller.attachMovie("pictureSymbol", picID, i+80);
    ThisNode = BaseNode.childNodes[i];
    tempItem = eval(picID);
    tempItem.setPosition(startX, startPos);          
    startPos += tempItem.getHeight() + incY;              
}
scroller.setMask(mask);
=====================================

is mask a movieclip? and what do you want to mask, scroller, or pictureSymbol?
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now