I’ve been following the transition tutorial on the main site and run into a few problems which I seem to have overcome. For example any text needs to either be embedded using the properties bar or using the library. If anyones stuck I’ll post the code.
However the main problem i’m having is loading in an external swf. I;ve created a scrolling gallery that duplicates an instance for each image stored in the array, this works perfectly on its own.
However after you load it into the maininterface with the transition it the scrolling gallery doesn’t work, it only shows the mc’s without the actionscript affecting them.
I have tried using loadMovieNUM which loads in the scrolling gallery and works but it appears on top of the main interface.
Any help in sorting this would be appreciated and I think should be included in the tutorial.
This is all the action script that handles the scrolling gallery component:
[AS]// Initialize useful variables and picture array
cellWidth = reel_mc.cell_mc._width;
center = Stage.width/2;
pics = new Array();
// Handler to move showreel left and right across the stage
_root.onEnterFrame = function() {
reelSpeed = (_xmouse-center)/10;
reel_mc._x += reelSpeed;
// Apply limits to reel position
leftStop = center-reel_mc._width+cellWidth/2;
rightStop = center-cellWidth/2;
if (reel_mc._x < leftStop) {
reel_mc._x = leftStop;
} else if (reel_mc._x > rightStop) {
reel_mc._x = rightStop;
}
};
// Define constructor function for Picture objects
Picture = function (name, link, color, description) {
this.name = name;
this.link = link;
this.color = color;
this.description = description;
};
// Define function for creating cells in the showreel
NewCell = function (num, details) {
// Create a new cell
originalClip = _root.reel_mc.cell_mc;
newClip = originalClip.duplicateMovieClip(“cell”+num, num);
// Set cell position and text fields
newClip._x = num*300;
newClip.name_txt.text = num+1 + ". " + details.name;
newClip.description_txt.text = details.description;
// Set cell content
content = newClip.placeholder_mc;
content.loadMovie(details.link);
// Set color of cell background
myColor = new Color(newClip.bgnd_mc);
myColor.setRGB(details.color);
};
// Set up picture objects
pics[0] = new Picture(“sammy”, “sammy.jpg”, 0xFF9999, “sammy dancing…”);
pics[1] = new Picture(“group”, “group.jpg”, 0x99FF99, “team routine…”);
pics[2] = new Picture(“girl2”, “girl2.jpg”, 0x9999FF, “girl in action…”);
pics[3] = new Picture(“girl3”, “girl3.jpg”, 0x9FF9F9, “girl twriling…”);
// Loop through array of picture objects, creating a new cell for each
for (i=0; i<pics.length; i++) {
NewCell(i, pics*);
}
[/AS]