Solved

attachMovie works only if used with _root.

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

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…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
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…

856 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