-
DB / Assets / DuplicateMC's / Malarkey
Hi all,
I have my (lots of help from the flashkit community) system working neatly, its pulling in records from the DB a pipe splitting each record, then a movieclip is duplicated
creating buttons, when you select the button it will download the appropriatley named file. I am over the moon that it is working
buttonArray = assets;
var lim = buttonArray.length;
trace (lim);
buttonX = 0;
buttonY = 0;
for (i = 0; i < lim; i++) {
duplicateMovieClip ("assets_mc", "activeassets_mc" + i, i + 1);
newButton = this["activeassets_mc" + i];
if (i % 2 == 0) {
buttonY++;
buttonX = 0;
} else {
buttonX++;
}
newButton._x = buttonX * assets_mc._width;
newButton._y = buttonY * newButton._height;
newButton.buttonText = buttonArray[i];
newButton.onRelease = function () {
if (_root.xxx == "x") {
getURL ("http://prototype.emarket2.com/echo/downloads/" + this.buttonText, "new");
set ("_root.happens.download", +this.buttonText);
loadVariablesNum ("http://prototype.emarket2.com/admin/log.php", 30, "POST");
} else {
setProperty ("_root.a", _visible, "1");
}
};
}
I now have two major queries :
1.How do I clear all the duplicated movieclips ? I have cleared the array and have resorted to a "manual" :
removeMovieClip ("activeassets_mc0");
removeMovieClip ("activeassets_mc1");
removeMovieClip ("activeassets_mc2");
removeMovieClip ("activeassets_mc3");
etc.,etc and clever ideas out there
2.More difficult i would like to have a description pop up on mouse rollover which I am totally lost in. Any input out there ?
Kindest
Craig
-
removeMovieClip is fine -- you can put it into a for() loop if you like.
for your popup - i think you mean a new window - you use javascript.
PHP Code:
<script language="JavaScript" type="text/JavaScript">
<!--
function openWin(url, w, h, l, t)
{
window.open(url,"","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=" + w + ",height=" + h + ",left=" + l + ",top=" + t);
}
//-->
</script>
call the function from Flash e.g. with:
PHP Code:
getURL("javascript:openWin('your_url', 200, 200, 100, 100);");
Hope that helps,
Garfield
Last edited by garfieldx; 05-13-2003 at 05:01 PM.
-
Thanks, but
Thanks Garfield,
but when I said pop up I meant a rollover flash pop up message using the db to create a tooltip effect.
any chance you could expand on the remove mc loop (a little help).
Kindest
Craig
-
Hi Craig,
for the ToolTipText you can use a MovieClip (MC) where you set MC.visible = false. On RollOver of your buttons you assign your ToolTipText to that MC and set visible = true. On RollOut you set the visibility again to false.
If you have fun and time you could even let the ToolTipText move with your cursor. (get the _xmouse and _ymouse properties)
For the removeMovieClip():
Just make a loop for the buttons you want to remove
for (i=0;i<lim;i++)
{
this["activeassets_mc" + i].removeMovieClip();
}
This was it!
-
Cooool thanks
Thanks garfieldx,
the removes work a treat I'll work on the tooltip.
Kindest
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|