Hey chuck similar loop but using scroll pane to create rows and columns and
then take a movie clip and duplicate it, what I am trying to do is assign a
dynamic number to each onRelease function to each button located in the
duplicated movie clip.
Its only assigns the last number.
My brain is fried and need help.
Here is my code:
loadVarsText = new loadVars();
loadVarsText.load("galconfig.txt");
// assign a function which fires when the data is loaded:
loadVarsText.onLoad = function(success) {
if (success) {
trace("done loading");
// Now that we know the data is loaded,
// set the text content of the Text Field
// with the instance name "scroller" equal to the
// contents of the variable
totalpics.text = "Total pictures in this gallery: "+this.numpics;
} else {
totalpics.text = "Pictures not loaded";
trace("not loaded");
}
scroller.setScrollContent("contentHolder");
// set scroller scroll bar style ///
scroller.setStyleProperty("shadow", 0x40);
scroller.setStyleProperty("face", 0x6C);
scroller.setStyleProperty("highlight", 0xAE);
scroller.setStyleProperty("highlight3D", 0xC6);
scroller.setStyleProperty("arrow", 0xCC);
scroller.setStyleProperty("track", 0xFF);
// set scroller scroll bar style ///
var scrollContent = scroller.getScrollContent();
var columns = 2;
var xSpace = 155;
var ySpace = 125;
var columnNum = 0;
var rowNum = 0;
var thisone = -1;
for (x=0; xcolumns-1) {
columnNum = 0;
rowNum++;
}
// properties of duplicated movie clips
///
// load pictures in
scrollContent["myMovie"+x].profile.onRelease = function() {
var whatlargepic = thisone;
trace("release"+scrollContent+thisone);
};
scrollContent["myMovie"+x]._x = -270.5+(columnNum*xSpace);
scrollContent["myMovie"+x]._y = -127.8+(rowNum*ySpace);
loadMovie("../images/flashgal/small/"+this.pics+"sm"+x+".jpg",
scrollContent["myMovie"+x].pic);
//scrollContent["myMovie"+x].lthumb.gotoAndPlay(2);
//trace(this.pics+x);
columnNum++;
}
scroller.refreshPane();
};
stop();
Tony...
- Original Message -
From: "Lewis, Chuck" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list"
Sent: Wednesday, May 10, 2006 3:47 PM
Subject: RE: [Flashcoders] attaching onMouseDown to dynamic movieClips
Try this:
//
this[mcName].onRelease = function() {
trace("Release = "+this);
}
//
this[mcName].onPress = function() {
trace("Press = "+this);
}
-- Chuck
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of edwin
Sent: Wednesday, May 10, 2006 5:24 PM
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] attaching onMouseDown to dynamic movieClips
I'm hoping someone can tell me what I'm doing wrong here, or help me
find a
better way of doing this.
I've got a simple movieClip in my Library set up as Export for
ActionScript.
I would like to place several instances of it onstage, and then assign
to
each instance some mouse behaviours. The code is as follows:
for (var i = 0; i < 3; i++) {
var myX = 150 * i;
var mcName = "myBox_mc" + i;
this.attachMovie("box_mc", mcName, i, {_width:100, _height:100,
_x:myX,
_y:100});
this[mcName].onMouseDown = function() {
trace(this);
}
}
stop();
The instances appear onstage correctly, but I get the same output when I
click on any of the three movieClips:
_level0.myBox_mc2
_level0.myBox_mc1
_level0.myBox_mc0
It seems like clicking on any one of the instances is equivalent to
clicking
on all of them.
Where did I go wrong?
Thanks
-edwin
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com