Solved

attachMovie works only if used with _root.

Posted on 2003-12-01
3
186 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
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

749 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