Home Tutorials Forums Articles Blogs Movies Library Employment Press
Prev Previous Post   Next Post Next
Old 10-23-2003, 05:12 AM   #1
Registered User
Join Date: Oct 2003
Location: Canada
Posts: 3
Send a message via MSN to cphunk
Default Target Previous Duplicate Movie

Hey everyone, I have a simple question for you. Hopefully someone can help here.

I'm currently duplicating a clip on the stage as a news item. The problem is. The textfield within the movie clip is resized based on the dynamic text's textHeight. The next duplicated movie must be placed so that it's 10px below the previous - dynamically sized duplicated movie. Do you follow me?

The problem is that, I can't get the previously duplicated clip's height. Is there a way to target your last duplicate somehow?

Here's the code:
You can even download the fla and text file here:

ActionScript Code:
n = _root.numberOfNewsItems;     objTexts = new LoadVars(); objTexts.load("newsText.txt"); objTexts.pntTimeline = this; objTexts.onLoad = function() { this.pntTimeline.dupClips(); };         dupClips = function(){    mc._visible = false;    for(var i = 0; i<n; i++) {          // duplicates mc and sets the text field to newsText.txt text var var pntThisDupe = mc.duplicateMovieClip("dupe"+i,i);  pntThisDupe.field.text = objTexts["text" + i]; pntThisDupe.date.text = objTexts["Date" + i]; pntThisDupe.field._height = pntThisDupe.field.textHeight; pntThisDupe.alphaClip._height = pntThisDupe.field.textHeight+10; // i thought the following would target the prev clip, but it doesn't          if(i > 0) {    var oneLess = i-1;    var newName = "dupe"+oneLess;      // traceing newName returns the correct previous clip    // but i cannot target it's values ..._y, _height for example    trace(newName);            _pntThisDupe._y = newName._height + 10; }             } };

Last edited by farafiro; 10-26-2003 at 03:01 AM.
cphunk is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT. The time now is 11:36 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.