hi guys,
I’m trying to create some flash that will attach a movie(collision_mc) only when another movies (camerView) x and z coordinates are met.
I am trying to do this within a for loop, and it is embedded within a game I’ve gotten from the 3D in Flash tutorials on this site.
Should I set this up within the same for loop as the rest of the movies that populate the scene, or should I set up a new for loop (as I have done)??
I am now trying to use onEnterFrame as I couldnt get it working properly without
I can not get it working for some reason.
Please see line 119-134 for relevant code.
you will have to comment out those lines to see the game before I tried to mess with this.
my fla file was too big so Ive attached the swf if thats any help?!
1.- That swf does nothing
2.- I didn’t understand a word
3.- from what I understood from the topic title, you want to load a movie in the coordinates given by another movie. Well, using on enterFrame you can tell the coordinate movie to record its _x and _y in the _root movie _root.movieX=_x, _root.movieY=_y.
Then when calling the attatch, use those variables.
If that is not what you meant… Then I’m sorry not to be able to help you
sorry, I should have commented out the code that was affecting the rest of the game before sending :ponder:.
not quite what I meant. I have an if statement that I have been tinkering with. I can sort of get it to work without using the onEnterFrame, but not quite, so I tried this way
we need a your fla source to help you out anymore … we can’t get it from your swf file …
the above code should have some more braces in them and you need to set the cameraView.onEnterFrame to be a function … right now you have it point to nothing …
the next question is why do you have a for loop of 10?
it looks like you have the cameraView set an empty onEnterFrame and then have the game check for collision 10 times
[AS]
cameraView.onEnterFrame = function(){
for (i=0;i<10;i++){
if (i<1 and cameraView.x >=-450 and cameraView.x <=450 and camerView.z <=3000 and cameraView.z >=4000) {
collision = theScene.attachMovie(“collision_mc”, “collision_mc”+i, i);
collision.x = 450;
collision.z = 3500;
collision.y = 0;
}else {
theScene.removeMovieClip(“collision_mc”);
}
collision_mc.display = displayFigure;
objectsInScene.push(collision_mc);
}
}
[/AS]
if we could get your fla or at least your code up on the forum we could help you better