Hi i have a problem with telling flash to look for my movie clip problem is that it has no instance name as the movie clip is added via action script but it has a linkage id called pane7, and within the movieclip has a button called one so how do i tell flash to look for this?
yes that works but not quite, it creates a new instance (sorry maybe i wasnt clear enough on what i wanted or what was happering the movie clip pane7 is already on the timeline moving spining around with other images and when you click on pane7 it jumps to frame 10 on the timeline
Here you go, I’ve left some panes out of the code, you can add these.
Important is that you give the button (in all the panes) an instancename ‘one’
stop();
this.createEmptyMovieClip("theScene", 1);
theScene._x = 290;
theScene._y = 220;
objectsInScene = new Array();
//twodimensional array the number is the frame you want goto
var paneArray:Array = [["pane", 10], ["pane1", 20], ["pane2", 30], ["pane3", 40], ["pane4", 50], ["pane5", 60], ["pane6", 70], ["pane7", 10]];
spin = 0;
focalLength = 250;
displayPane = function () {
var angle = this.angle-spin;
var x = Math.cos(angle)*this.radius;
var z = Math.sin(angle)*this.radius;
var y = this.y;
var scaleRatio = focalLength/(focalLength+z);
this._x = x*scaleRatio;
this._y = y*scaleRatio;
this._xscale = this._yscale=40*scaleRatio;
this.swapDepths(Math.round(-z));
};
angleStep = 2*Math.PI/15;
for (i=0; i<15; i++) {
//get the first element of each array item
attachedObj = theScene.attachMovie(paneArray*[0], "pane"+i, i);
attachedObj.angle = angleStep*i;
attachedObj.radius = 160;
attachedObj.x = Math.cos(attachedObj.angle)*attachedObj.radius;
attachedObj.z = Math.sin(attachedObj.angle)*attachedObj.radius;
attachedObj.y = 30;
attachedObj.display = displayPane;
//give each pane its id
attachedObj.id = i;
//inside the panes give all the buttons an instancename one
attachedObj.one.onRelease = function() {
_root.gotoAndStop(paneArray[this._parent.id][1]);
};
objectsInScene.push(attachedObj);
}
panCamera = function () {
spin += this._xmouse/4000;
for (var i = 0; i<objectsInScene.length; i++) {
objectsInScene*.display();
}
};
sorry to ask for you help again scotty but, for some reason when you click on pane7 and it gotos frame 10 the carosuel is still there even though inthe time line the action script isnt placed at frame 10 so how can i get the carasouel to stop and disapear when u click on a pane and if i add a back button to say frame 10 the carasouel reapears? thanks here my new sourse file
to view the effect click link below (but dont worrie about the gap that appear in the caroseul effect because pane13 and 14 for some reason where playing up when i created that swf)
displayPane = function () {
var angle = this.angle-spin;
var x = Math.cos(angle)*this.radius;
var z = Math.sin(angle)*this.radius;
var y = this.y;
var scaleRatio = focalLength/(focalLength+z);
this._x = x*scaleRatio;
this._y = y*scaleRatio;
this._xscale = this._yscale=40*scaleRatio;
//changed next line so all panes are on a removable depth
this.swapDepths(8000+Math.round(-z));
};
angleStep = 2*Math.PI/15;
for (var i = 0; i<15; i++) {
//get the first element of each array item
attachedObj = theScene.attachMovie(paneArray*[0], "pane"+i, i);
attachedObj.angle = angleStep*i;
attachedObj.radius = 160;
attachedObj.x = Math.cos(attachedObj.angle)*attachedObj.radius;
attachedObj.z = Math.sin(attachedObj.angle)*attachedObj.radius;
attachedObj.y = 30;
attachedObj.display = displayPane;
//give each pane its id
attachedObj.id = i;
//inside the panes give all the buttons an instancename one
attachedObj.one.onRelease = function() {
_root.gotoAndStop(paneArray[this._parent.id][1]);
//remove the panes
removePanes();
};
objectsInScene.push(attachedObj);
}
function removePanes() {
for (var i = 0; i<15; i++) {
theScene["pane"+i].removeMovieClip();
}
}
In the target frames have a back button that with gotoAndStop(1) action