Solved

attachMovie works only if used with _root.

Posted on 2003-12-01
3
187 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 27

Accepted Solution

by:
negatyve earned 125 total points
ID: 9854349
=====================================
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

696 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