Movie Clip Orientation Issues.
Hi im very new to actionscript. About a week. I made a pac man movieclip, that moves left when you hit the left arrow, down when you hit the down arrow, etc..... The movie clip also orientates itself so pacmans mouth is facing the direction you are moving.
I'm having a problem with the movie clip when you hit the left arrow then down, the mouth goes up, and when you hit the left arrow then up mouth goes down..
This only happens after you hit right, then left, and only occurs when the face is facing left. All the other directions work fine... if that makes sense. Heres the code:
Code: onClipEvent (load) { x = this._x; y = this._y; resetRotation = this._rotation; speed = 5; } onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) { this._rotation = resetRotation; this._xscale = 100; x -= speed; } if (Key.isDown(Key.RIGHT)) { this._rotation = resetRotation; this._xscale = -100; rightActive = true; x += speed; } if (Key.isDown(Key.UP)) { y -= speed; if (rightActive == true) { this._rotation = -90; } else { this._rotation = 90; } }
if (Key.isDown(Key.DOWN)) { y += speed; if (rightActive == true) { this._rotation = 90; } else { this._rotation = -90; } }
this._x = x; this._y = y; }
CLICK TO VIEW THE MOVIE Heres the link to swf so you can test the video. Click Right then up down, then Left and up and down.. See what happens?
Thanks
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 09-24-2006, 08:12 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
[F8] _rotation Issues Calculating Orientation On A Circular Path, Scalextric/slot Car
Hi guys,
Basically I'm attempting to build a scalextric (slot car) race game - simple 2d top-down style.
The basics are easy - for now I'm using a timeline motion guide/path and adjusting the frame depending on speed etc. - this works well and I'm happy with it (although eventually I'll upgrade to dynamic paths and track builder)
The problem I'm having is that of getting the car to 'realistically' skid out on corners depending on speed - I'm doing a little calculation where I work out the difference between the car's previous _rotation and the car's current _rotation and then multiply this value by the current velocity and smooth out the result using a method very similar to the old 'smooth preloader' tutorial - this new rotation value is applied to the _rotation property of a movieclip inside of the movieclip that is following the path/guide.
This works great - except there is one point on the track where the the car does a full 360 (or just twitches) - on the demo press the UP key to accelerate and just go 'full pelt' round the track and you'll see it happen in the top left (just past the top left corner)
The problem is something to do with how i'm calculating a setting rotations (incidently i found that flash uses -180 to 180 instead of 0 to 360)
can anybody understand what is going wrong? and how to fix it?
Thanks,
Jon
_rotation Issues Calculating Orientation On A Circular Path (scalextric/slot Cars)
Hi guys,
Basically I'm attempting to build a scalextric (slot car) race game - simple 2d top-down style.
The basics are easy - for now I'm using a timeline motion guide/path and adjusting the frame depending on speed etc. - this works well and I'm happy with it (although eventually I'll upgrade to dynamic paths and track builder)
The problem I'm having is that of getting the car to 'realistically' skid out on corners depending on speed - I'm doing a little calculation where I work out the difference between the car's previous _rotation and the car's current _rotation and then multiply this value by the current velocity and smooth out the result using a method very similar to the old 'smooth preloader' tutorial - this new rotation value is applied to the _rotation property of a movieclip inside of the movieclip that is following the path/guide.
This works great - except there is one point on the track where the the car does a full 360 (or just twitches) - on the demo press the UP key to accelerate and just go 'full pelt' round the track and you'll see it happen in the top left (just past the top left corner)
The problem is something to do with how i'm calculating a setting rotations (incidently i found that flash uses -180 to 180 instead of 0 to 360)
can anybody understand what is going wrong? and how to fix it?
Thanks,
Jon
_rotation Issues Calculating Orientation On A Circular Path (scalextric/slot Cars)
Hi guys,
Basically I'm attempting to build a scalextric (slot car) race game - simple 2d top-down style.
The basics are easy - for now I'm using a timeline motion guide/path and adjusting the frame depending on speed etc. - this works well and I'm happy with it (although eventually I'll upgrade to dynamic paths and track builder)
The problem I'm having is that of getting the car to 'realistically' skid out on corners depending on speed - I'm doing a little calculation where I work out the difference between the car's previous _rotation and the car's current _rotation and then multiply this value by the current velocity and smooth out the result using a method very similar to the old 'smooth preloader' tutorial - this new rotation value is applied to the _rotation property of a movieclip inside of the movieclip that is following the path/guide.
This works great - except there is one point on the track where the the car does a full 360 (or just twitches) - on the demo press the UP key to accelerate and just go 'full pelt' round the track and you'll see it happen in the top left (just past the top left corner)
The problem is something to do with how i'm calculating a setting rotations (incidently i found that flash uses -180 to 180 instead of 0 to 360)
can anybody understand what is going wrong? and how to fix it?
Thanks,
Jon
Controlling The Print Orientation From Swf Movie
hello everyone!!
i need to be able to control the print orientation from the print command on the swf movie i've created(this is a projector movie not viewed in a browser window). i need it to print in landscape orientation every time without having to make any changes in the os system print command window. can anyone help me with this?
thanks for any help!
wade
Movie Clip Issues
I'm trying to make a movie Clip play with just the movieClip.play(); when I run it, it won't play. It only works with movieClip.gotoAndPlay("something"); that works. I'm still trying to understand the basics of proper targetting with AS3, which seems more complicated than AS1 & 2
Issues Reversing A Movie Clip ... Help Me.
I know this cant be too difficult: help me?
I know how to reverse a movie clip with not Problem. But here is my problem:
Lets say I have two buttons ok: HOME, ABOUT
Lets say I click, HOME. A screen Zooms IN.
NOw I want to Click ABOUT button.
When I click AbOUT, I want the HOME MOVIE to REVERSE and the ABOUT MOVIE TO ZOOM IN..
I TRied it, But How do I SEt Which plays first. it works, But it all Plays at the same time. i WANT whats every opened to REverse First Then PLay what I Pressed.
CAn anyone help me.
If you need a better explanation, Please email me at elpolo125@aol.com.
Movie Clip As Button Issues
Fustrated with FLASH. I'm gonna ****ing explode! I hate this ****. Why can't something so ****ing simple work?
2 problems!!! 2!!!!!!
1st Problem) I have 2 groups of words on the same layer. When I play the masked animation, only 1 group of words actually show the animation. The other just sits there.. As if nothing happens.
2nd Problem) I have a movie clip. I want to use it as a button so that when I press the button it goes to a new scene, but also when I have the mouse over it, it plays the animation in the movie clip. I have done so many different approaches to this. I have tried to do it from the outside _root timeline with the following:
Yellow_Square.onPress = function () {
gotoAndPlay("Scene 2", 1);
};
Yellow_Square.onRollOver = function() {
gotoAndPlay("Yellow Square", 2);
};
Also I have tried to make a button inside the movie clip to do the same things. In the movie clip I had:
on(press){
gotoAndPlay("Scene 2", 1);
}
on(rollOver){
gotoAndPlay(2);
}
both which are NOT working.
If you can help me please IM me on AIM my sn is
DuyKatoMon
I'm so fustrated and confused. It should be fairly simple, but I don't understand why it's not working. Something I overlooked?
Project Help (Movie Clip Issues)
okay, i asked for help on this paticular project last week, and got some good info. the thing is, i kind of did things, well, wrong. Basically, what I am trying to do is whenever i press a "thumbnail" movie clip which i have arrranged in a nice little sliding thing, is to have it pull up a related movie clip (basically, a big version of the thumb) above it (maybe put it in a sort of blank container clip i would keep on the screen)and I need some help making that happen.
it's just that I am completely inept when it comes to action script. The textbook we use is horrible, and i sort of forgot to pay attention in class most of the time, so I need serious help.
I have included a few print screens that show visually what I want to happen on the stage. thanks in advance for any help given
[MX04]movie Clip Issues
hello
I have put a movieclip in scene1 and animated it, I want to export the file as a quicktime but when I do this it only shows me the first frame of the movieclip.
In scene1 I thought if I convert the movieclip animation to keyframes, instead of a tween it would fix the issue , but it didnt work.
any ideas?
[F8] - Issues With _x Prop For Movie Clip
Ok, so I have a cursor icon in a movie clip. I place it on the stage at an X position of lets say 25. I then call a function based on a keyboard press that says move the cursor. So something like
function moveCursor(){
if(cursor_mc._x==25){
cursor_mc._x=35
}
}
The problem is it won't pick up on 25. If I save >=25 it works. When I do a trace it says it is 25.
Is there a better way to get that value? Thanks.
Movie Clip Depth Issues...
I have 8 movie clips that are in a row that have instance names. When you rollover them they enlarge and overlap each other. Problem is I always want the rollover one to be in front of all the others. Arranging the layers will do nothing but just put that one clip on top of the other. I am very unaware of how these need to be set up on an actionscript end of things. Can someone help??? I am very newbie to the AS here...
CreateTextField On Top Of Movie Clip Issues
Hi,
sorry if this is a bit of a noobish question but I am having problems creating a text field on top of a MovieClip object using only Actionscript.
I am using a MovieClip to display an image as a background; and then I want to put a textfield on top of that.
When the image is not loaded the textfield displays fine; however if I set the background before creating the textfield the text does not show up.
I have checked the Depth values for both the textfield and background and text.depth > background.depth
Does anyone have ideas on what else could be causing this to happen?
TIA
Importing A Movie Clip. Having Some Issues
I am making a flash movie that has buttons on it. i have the buttons set to load an external movie clip. the clip that i am loading has animations on it and it plays fine, but when i navigate to that movie clip by clicking on the corresponding button everything turns white expect for the black colors on some strokes and text in the animation. the animation is the only thing that is now on the screen, the buttons are gone and the background colors are gone as well. i have other buttons that navigate the exact same way but i have no troubles with them, only this one button. does anybody know what is going wrong? If you have any input, i am pretty new to flash so if you have any explanations i would really appreciate it if you could step me through. thanks!
Movie Clip Loader Issues
EDIT: SOLVED.
I've got some pretty strange looking code here... but for some reason my movie doesn't load anything at all. I don't get any errors at all, but it just doesn't load. I think it might have something to do with the MCL stuff, but you tell me.
Code:
var var_service = random(8)
var lock = "off";
mov_mcl = new MovieClipLoader();
mov_list = new Object();
pic_mcl = new MovieClipLoader();
pic_list = new Object();
//function listing:
function phase2() {
mov_mcl.loadClip("index_1_play.swf","_parent.container_mc")
clearInterval( phase2_var )
trace("running phase2");
}
function delaySwap() {
whiteflash.gotoAndPlay(2)
loadNext()
clearInterval( delaySwap_var )
trace("running the delaySwap function");
}
function loadNext() {
++var_service
if(var_service >= 8) {
var_service = 0
}
pic_mcl.loadClip("random-index/"+var_service+".jpg","pic1_load")
}
//load completes:
mov_list.onLoadComplete = function() {
_parent.container_mc.gotoAndPlay(2);
}
pic_list.onLoadComplete = function() {
if(lock == "off"){
gotoAndPlay(2);
phase2_var = setInterval(phase2, 1000)
lock = "on";
}
delaySwap_var = setInterval(delaySwap, 6000)
whiteflash.gotoAndPlay(11);
}
// starts off the whole thing:
pic_mcl.loadClip("random-index/"+var_service+".jpg","pic1_load")
//listeners
pic_mcl.addListener(pic_list);
mov_mcl.addListener(mov_list);
stop();
Movie Clip Loader Issues
EDIT: SOLVED.
I've got some pretty strange looking code here... but for some reason my movie doesn't load anything at all. I don't get any errors at all, but it just doesn't load. I think it might have something to do with the MCL stuff, but you tell me.
Code:
var var_service = random(8)
var lock = "off";
mov_mcl = new MovieClipLoader();
mov_list = new Object();
pic_mcl = new MovieClipLoader();
pic_list = new Object();
//function listing:
function phase2() {
mov_mcl.loadClip("index_1_play.swf","_parent.container_mc")
clearInterval( phase2_var )
trace("running phase2");
}
function delaySwap() {
whiteflash.gotoAndPlay(2)
loadNext()
clearInterval( delaySwap_var )
trace("running the delaySwap function");
}
function loadNext() {
++var_service
if(var_service >= 8) {
var_service = 0
}
pic_mcl.loadClip("random-index/"+var_service+".jpg","pic1_load")
}
//load completes:
mov_list.onLoadComplete = function() {
_parent.container_mc.gotoAndPlay(2);
}
pic_list.onLoadComplete = function() {
if(lock == "off"){
gotoAndPlay(2);
phase2_var = setInterval(phase2, 1000)
lock = "on";
}
delaySwap_var = setInterval(delaySwap, 6000)
whiteflash.gotoAndPlay(11);
}
// starts off the whole thing:
pic_mcl.loadClip("random-index/"+var_service+".jpg","pic1_load")
//listeners
pic_mcl.addListener(pic_list);
mov_mcl.addListener(mov_list);
stop();
Position Orientation Point To Center In Imported Movie
I am using the following code to import my mini race car into my game
_root.createEmptyMovieClip("Car", 1);
_root.Car.loadMovie("resources\car1.png");
it loads it and works great, the only problem is it sets the orientation point to the top left, and it needs to be in the center for the car to rotate correctly... any suggestions would be greatly appreciated :-)
Position Orientation Point To Center In Imported Movie
I am using the following code to import my mini race car into my game
_root.createEmptyMovieClip("Car", 1);
_root.Car.loadMovie("resources\car1.png");
it loads it and works great, the only problem is it sets the orientation point to the top left, and it needs to be in the center for the car to rotate correctly... any suggestions would be greatly appreciated :-)
Load Movie Clip Troubles (i Have Several Issues)
hi
as a fairly new flash user, my brain is boggled by actionscript...
i am producing a site that will be made into a projector file & distributed on cd. the meat of it is a video & slide presentation. the videos are talking head sections sandwiching the slides (in other words there's an intro video, then the slides, then a closing video). after much finagling, i got the videos to look decent & show up in the flash site. since they're pretty large, i decided to bring them in as outside swfs within an empty movie clip with the load movie action. so, i plopped an empty clip within my scene (called "emptyclip" and it has the instance name of "loadingmovie"), then i attached the following actionscript to it:
onClipEvent (load) {
loadMovieNum("introedit00.swf", 1);
gotoAndPlay("slides");
}
i loaded it into level 1, since when i loaded it into level 0, nothing showed up of my scene EXCEPT the video. all around it was white, even tho the scene has a background color, logo, header & some navigation buttons!
so, here are my problems:
1. no matter where i place the little circle that indicates "emptyclip," the video plays in the upper left hand corner of the window--covering up other things in the background of the scene. i've tried moving the little circle around all over the place, but there's no change to its placement.
2. i then want the clip to play thru and go on to the slides movie clip (i named the frame label of this section "slides"), which i've placed on the timeline in a keyframe right after the keyframe which contains the first empty movie clip with the video loading into it. how do i do that?
3. finally, i'll need the closing video to be triggered right after the slides play. any suggestions there?
i've been working on this problem for several hours. i've read forums, tutorials, etc. i'm going a wee crazy.
thank you in advance for your help...
Movie Clip Control, Navigation Issues
navigation control question (help please)
Hello, i'm having trouble with multi button controled movieclip, I'm trying to make a rollover activated animation ( i think it is 40 frames) and the animation will play, then stop at a predetermined location, when you roll "out" of that button the movie clip should play back to the original(start) position. but if you roll over another button, it will move to position... and react the same with each buttons.
I uploaded a fla for a more comprhensive explanation, considering i've been working for the past 15 hours, my englis idn't whud id wons wus.
http//:www.exactpixel.com/rolling_over.fla
i've tried a few different ways to imitate this, but each has pissed me off and i have to have a working demo by friday, otherwise i'd take my time and try a few more methods but i still have the rest of the damn thing to put together, tons of animations.... blah
oh yeah, thank you all.
Issues With Calling Sounds In A Movie Clip
Ok, Heres the nuts and bolts of it
i am currently working on a game that has sounds working fine in them when i attach them using actionscript, but the nature of the sounds and my own personal vedetta against wasting cpu cycles has put me into a position where i took a bunch of sounds and put them into a movie clip, that way i could tell if a certian sound is playing via which frame it is in..sounds simple correct..
one of my issues deals with calling the score of the game, the score can be love, 15, 30, 40, adv, - , or deuce
the score is computed when someone scores a point and then it calls this
_root.Sounds.gotoAndPlay("Pre-Score"+math.ceil(math.random()*2));
so, from this you can tell that i have a movie clip called Sounds on the stage, and that it has a label called Pre-Score1 or Pre-Score2. This is not the problem, it will play the sound located in either label that it needs to play at the end of the sound, in a keyframe will encounter this
// at the end of this saying we want to go to the player who's serving's score
_root.playScore = 1
if(_root["player"+_root.playerServer].score == "deuce" || _root["player"+_root.playerServer].score == " - " || _root["player"+_root.playerServer].score == "adv"){
if(_root["player"+_root.playerServer].score == "deuce"){
randomnum = math.ceil(math.random() * 3);
_root.Sounds.gotoAndPlay(String(_root["player"+_root.playerServer].Score)+ randomnum);
}
_root.playScore = 0
}else{
_root.Sounds.gotoAndPlay(String(_root["player"+_root.playerServer].Score));
}
this declares a varible for wether or not the score has been completely played yet, then asks if it is any of these conditions, which it skips over when needed, the big problem is encountered here
}else{
_root.Sounds.gotoAndPlay(String(_root["player"+_root.playerServer].Score));
}
i'm trying for the script to go and play the label in which relies to the score
all the labels in the Sound Movie clip are correctly spelled, and it seems that it is always taking the arguement for gotoAndPlay to be a frame number...i have no clue why
if you can understand any of this and might have an answer, feel free to reply, thanks in advance
any clarification will be given upon request
Text Scrollbar/Movie Clip Issues
I have created a movie clip which features a text box and scrollbar. This works fine.
But when I have this movie clip (swf) opening within another flash document the scrollbar doesnt work...the rest of the movie clip works fine (and the mouse recognizes the scrollbar buttons), but the scrollbar won't scroll.
any suggestions??
Movie Clip Rollover Issues...frustrated :(
I have what I thought would be a simple issue to solve, but nothing I've tried has worked the way I want it to. Any help would be appreciated.
I have a movie clip I've assigned to be invisible when you rollover it. So on the MC I have:
on(rollOver){
this._alpha=0;
}
on(rollOut){
this._alpha=100
}
[sidenote: I've heard that ._visible is less processor intensive, but for some reason _visible set to true and false didn't work, it resulted in my MC flashing whenever i rolled over it...?? Can somebody tell me why?]
So that works fine. And then I have the MC as a link to another part of my flash file:
on(release){
_root.gotoAndPlay("frameLabel")
}
Which also works fine. And in this way I've set up a website, with each page of my site on a frame on the root timeline and given a frame label, and these MC's as links to all the pages. However, when you transition from one page to another, I've animated the movie clips to a different position. Which means when a new page opens, if your mouse happens to be over one of the movie clips, it's invisible to start with because of the rollover function I've applied to it. This, I DON'T want. I want the MC to be visible when the page is loaded, and THEN when the user rolls over it, for it to disappear.
Basically, I'm asking: Is there a way I can specify to Flash a difference between 'the action of rolling over" as opposed to "the mouse is already rolled over it to begin with"....or....can I have the rollover "disabled" until the user first moves the mouse?
My simple (attempted) solution:
I discarded the alpha actions assigned to my MC, and inside my MC itself I just created an "on" state in one frame (where alpha=100) and an "off" state in the second frame(where alpha=0).
Then in the hopes of having the MC be visible when it loads, regardless of where the mouse is, I put the code on the MC that says:
onClipEvent (load) {
gotoAndPlay("on");
}
on (rollOver) {
gotoAndPlay("off");
}
on (rollOut) {
gotoAndPlay("on");
}
but this didn't seem to work. I've tried variations of the above, using onClipEvent (enterFrame), using gotoAndStop, using frame numbers instead of labels......no dice.
What I ended up doing was just having about 5 frames for the "on" state, but this creates more problems (doesn't work at all if there is a stop action at the end of the "on" frames; and any subsequent rollover will be "on" for five frames before it goes to the "off" state, to name a couple). If it is AT ALL possible, I would rather have it a function of the user first moving the mouse, or Flash tracking the rollovers, instead of it being based on the frames themselves.
Am I missing something fundamental? I'm still fairly new to actionscripting, and knowing the most efficient ways to go about doing things.
Please.....help if you can... I can't attach my file, (even a modified, partial version) b/c it's too large.
Project Help (Movie Clip Resizing Issues)
ok, basically what i need to do is take these little thumbnail images and be able to make them grow to normal size whenever the mouse rolls over it and then go back to a thumbnail when i press the mouse, making a sort of interactive slideshowesque thing.
the problem is, I have tried every action script I can to do this, and nothing is working. I don't know if there is something wrong with my approach itself, or if it's something I'm forgetting but the scripts don't work.
if anyone has any tps on how to do this, please post quickly ^_^
Movie Clip Issues With SwapDepths Command
I've created this source file as an excerpt from a larger project, but it has the same issue...click next and then next and then move the mouse over the menus...now click back and you see parts of the menu are still visible - why is this happening? How can I make the menu disappear when the back button is clicked?
Thanks,
David
Movie Clip - On(rollOver) On(rollOut) Issues
I've just upgraded to Studio 8 and create all of my buttons for the sites I make as movie clips. I'm having an issue in the on(rollOver) and on(rollOut) states.
It does go to the animation in the movie clip correctly, however, if you mouse over it and out again quickly the frames inside the movie clip seem to "trip over" each other and it seems as though the movie clip loses its place in the timeline.
What's the easiest way to remedy this? Is there a script? Easier way to make animated buttons?
Any assistance is greatly appreciated.
Thanks.
Animated Movie Clip Button Issues
Please anyone who is an expert, I desperately need your help. I have got this movieclip button right. And it works like a charm. However, I cannot get the button to gotoandplay on a frame in the original Scene. I have tried everything. This is what the code on the hit area within the movieclip button reads.
on (rollOver, dragOver) {
gotoAndPlay("s1");
}
on (rollOut, dragOut) {
gotoAndPlay("s2");
}
[FMX2004] Movie Clip Scripting Issues
I just finished doing the Falling Snow tutorial on this site, and it works...My issue is::
HOW DO I GET THE SNOW TO STOP?
I want it to play through the first scene, but when I get to Scene 2 it is still going....Any suggestions? If it's a simple stop action, where do I put it?
Any help would be great thanks.
--Doug
Movie Clip Button Issues [Sound]
Hello, i just recelty started using invisable movie clips for buttons, and for the first time i need to add a rollover sound, im not familiar with attach sound or anything like that so if anyone has any resources i can read up on it would be nice!
thanks.
Issues With Form Fields, Using A Swap Movie Clip
I have a preloader, movie and then a separate form .swf. Following some of the tips I have read here I made the preloader it's own movie that loads in the main movie into it using loadmovie. Now inside that main movie I have a swap MC that when the movie is finished it loads the form .swf. Everything works very well, except the form fields(input text boxes) are not showing up at all in the main movie once the form .swf is loaded. The rest of the form .swf's graphics and text labels show up, just not the form fields. If I run the form .swf separately I get the form fields. Seems I only lose the form fields when it is loaded into the main move. I have looked and looked and I cannot figure this out.
I appreciate any input anyone can give to help me with this issue.
Button Movie Clip Control And Alignment Issues
I’m trying to develop a flash based website to showcase our house project. My question is this: I have three plans that are on three different layers. I want users to be able to click on any of the three plans to 1) view a small version (a large thumbnail) 2) the option to open a larger view of the plan in a new window, or 3) return the plan to the its original location.
My desire is to animate the plan to “rotate” clockwise from its staring place to the display place (motion tween) elsewhere on the stage. If the user decides they do not wish to view the plan I want the user to have the option to click the plan which will cause the plan to rotate counter clockwise back to the starting position.
My other question is how to align a jpeg within a clip when it is loaded using the loadmovie action script. When the elevation is loaded into an instance “clip” the picture is located to the bottom right within the instance that I’m loading it to. Frustrating. My desire here is to align the picture in the center both horizontally and vertically.
Migration Issues / Setting Height Movie Clip
I have migrated Action script 1 to 2. In action 1 , I was able to set the
distance between two clips by Square Root((x1-x2)^2) + ((y1 - y2)^2)
rotation by atan / Radians to degrees.
I tried this after migration and the distance actually set(in pixels) is way out of whak. I have tried Line To method which gives correct distance but incorrect angle.
I have triple checked the code and calculations and can't find the fault.
Any Ideas?
I plan on some Planar XYZ displays so would prefer to not rely on "line to"
I can post the code if required
Targeting Child Movie Clip OnRollOver Issues
I'm been writing AS for a while so I'm totally stumped on this one. How do you target the child clip of a movie for a rollOver action? Here is the code I am using - pretty straight forward. I have one clip called main_mc that has two clips within it: mc1 and mc2. I can set the alpha property with this targeting, but not the rollover. Nothing gets traced to the output window on rollover of child movieclips. What's going on?
main_mc.onRollOver = function(){
trace("main mc rolled over");
for (i=1; i<3; i++){
this["mc" + i].onRollOver = function(){
trace("mc1 or mc2 rolled over");
}
this["mc" + i]._alpha = 50;
}
}
Scope Issues Arising From Loading Clip Into Another Movie
My main.swf file used to be a standalone file. For that reason, it uses _root.functionName() and _root.clip._property and _root.gotoAndStop("frameAnchorName") and all kinds of other _root-based absolute references.
In order to get my preloader working (I was having export-in-first-frame issues), I had to create a second .swf file (holder.swf) with the preloader, and then load the main.swf file into it using movieClipLoader. As a consequence, none of my _root-based statements work. And when I change them to relative references, all the positioning gets screwy. A statement that says _root.clip._x = 50 used to position an object correctly, but now it positioning it somewhere else entirely, relative to the holder.swf movie.
Is there any easy way to fix this? Or do I have to go through and change every single absolute reference to a relative reference (this will cause sooo many bugs I'm sure).
Movie Clip Button - Action Script Issues
This is a two part question:
1. I have my movie clip button, "mcAboutus" then inside my movie clip I have 5 layers: actions, labels, text, animated rollover("mcAboutusover"), animated rolloff("mcAboutusoff"). On the labels layer I have _up, _over, _off. On the _up is the text layer, on the _over is a movie clip of the animated rollover("mcAboutusover") which is 90 frames, and I want to loop as long as the mouse is over the text. And the _off has the "mcAboutusoff" movie clip.
So I was able to have the rollover work, but when I roll off the rollover animation continues on until the end of the animation. I understand it has to do with the fact that it's a movie clip, but how do I point it to go into the movie clip and read the animation and that on the last frame of the animation I have a "gotoAndPlay(1);" to have the animation continue looping as long as it's in a rollover state?
here is the code I have for the _root:
this.mcAboutus.onRollOver = function() {
mcAboutus.gotoAndPlay(_over);
}
this.mcAboutus.onRollOut = function() {
mcAboutus.gotoAndPlay(_off);
}
The other problem I am having is that once the I have rolled over the animation once, the button dies and won't let me rollover it again?
Aside from the "stop();" action in the mcAboutus movie clip symbol, I don't have any other actions, should I put items in the different movie clips I have set up?
ALSO.... The reason that I have the main movie clip button, and two movie clips residing in the mcBtn is I wanted light rays to be glowing from the text, and I was having a hard time getting what I wanted from Flash, so I created in After Effects and exported two .SWF files. So those .SWF files are the _over and _off states in the mcBtn. I am having a very hard time controlling those Movie Clips within the main MC Button. Please, any help would be greatly appreciated.
Edited: 02/26/2007 at 11:40:26 AM by djelder
Flash8 Help Needed Sound Issues In Movie Clip
So... not completely new to Flash 8 - just new to having to explain anything.
I have a movie that plays on stage, there are actually several and they all work fine (sound and everything). One in particular, the sound stops in the middle of the movie and I just cannot figure out why. I have tried everything I can think of for the past two days to no avail! The regular Quicktime movie definitely has sound all the way through and I have checked so many times - HA! I am totally frustrated and begging for any suggestion!! please? Thanks so much!
Issues Targeting Movie Clip Names Through An Array
HELP! this is driving me crazy.... I'm simply trying to target an array of movie clip instances, but cannot seem to get it right. The names placed directly on the root work, but not the ones that are placed inside a separate clip imported via loadMovie & named "additionalRow"?!
here is the code:
var instanceArray:Array = [additionalRow.FalconsMC, additionalRow.SeahawksMC, VikingsMC, additionalRow.PanthersMC];
var arrayLength:Number = instanceArray.length;
for (var i:Number = 0; i<arrayLength; i++) {
//this.additionalRow.instanceArray[i].tween("_alpha", 50, 1, 0);
this.instanceArray[i].tween("_alpha", 50, 1, 0);
}
any help would be greatly appreciated.
Making A Movie Clip In A Movie Clip Go To The Next Frame Of The Original Movie Clip
I have a movie clip (for simplicity I'll call it movie_a) in movie_a I have another movie clip movie_b.
in movie_a i have a button that when pressed makes movie_b play (it has a stop frame every once in a while so the button acts as a "next" button)
I want it so that when i get to the last frame of movie_b and press the button, it will go to the next frame of movie_a
I hope that doesn't confuse u and u can help me solve this problem, as i am stumped and I've tried everything I could think of (which isn't that much as I'm not too good with actionscript)
thnx
Loading Movie IsSues And Other Issues
i have a main movie and i when an name is cliked on the navigation bar i would like the new movie to load. so there are seeral issues i am having..
1. i am not sure if i am doing this correctly - i am trying to use tutorials.
2. when i load the "services" movie my text will not show up either.
3. i need help by some one that has a lot will be nice i am in a learning phase
CAN SOME ONE PLEAE HELP
THIS IS THE LINK - GIV EIT AINUTE I HAVE NOT PUT ANY PRELOADERS UP YES. I CAN SEND THE FLA FILES FOR MORE HELP
MC Orientation ?
Does anyone know how to change the orientation of a movie clip? For example, some of my MC's consider (0,0) the top left corner of the clip, and some consider it the center of the clip. I need to change the ones that have it oriented in the center to be oriented in the top left corner. I'm not sure if this matters, but some of the MC's are being attached from the library, and aren't on the native timeline at runtime. Help!
Orientation Problem...
Hello all,
Here is my problem as it was told to me. I have a main scene labeled "Main" (smart, eh?) then to the upper right I have a mc called "Menu" with and instance name "Menu". Inside of that movie clip I have another mc called "Slide" for a sliding bar that moves along the _ymouse axis. But for some reason rather than following the _ymouse axis of the main stage, the Slide mc is under the mouse by about two inches, works fine, but still under rather than following it. I had another user tell me this was because the mc was not oriented at 0 and therefore was off by whatever distance the mc in the upper right was from 0 (making sense?). Here is the code with the changes given by the other user. But no matter how much I try to compinsate for the orientation, the Slide mc doesn't get any closer to the mouse.
onClipEvent (enterFrame) {
difference = (_root._ymouse - this._y)-100; <--this is the diff
if ((difference)<2) {
this._y = _root._ymouse;
} else {
moveBy = difference*.25;
this._y += moveBy;
}
}
Anybodies help on how to reorient the MCs would be greatly appreciated! Even if someone can just explain how to Orient new mcs cause I don't understand it!
Thansk everyone,
-Twizz
How To Set Print Orientation
Hi,
I am using Flash MX, there I need to change print orientation. Default is Portrait, I want to make it Landscape, How do I do that, please any one help me...
Centre Of Box Orientation
Hiya!
I'm having a huge problem with a movie clip loader I am trying to import photo's into a rectanglar box as a movie loader from buttons that have the following action script on:
on(release) {
mc_loader.loadMovie("l1.jpg")
}
The script isn't the problem, the button displays the correct photo in the loader box, but the top left hand corner of the photo is in the middle of the loader. This means that the image is all wrong.
How do i change the orientation of the centre of the loader to the top left hand corner?
Thanks, if you can help it will save me many headache's!!
Claire
Object Orientation
I made a thing where this pacman like object follows the mouse, trailing behind it. But i can't figure out to make it allways face the mouse, like how you orient something to a motion path. can anyone help?
Orientation Dilemma
Sup folks, I have a little problem on my hands and I was hoping some one here could cure my noobishness.
I have a movie clip that rotates and then stops when the mouse hovers over any of the 5 circles that border the points of the rotating star. I am trying to make a button pop up at the point of the circle the user hovered over, not necessarily his mouse position. However, whenever I tried to give the button a new x position, it uses the circle's original position as opposed to its new position factoring in rotation. Any idea on how to get its current position?
Can I Change The Orientation Of An Swf?
I have just an swf file of a flash movie that for some reason is flipped sideways. Is there any way I can easily (being the key word) flip it back round. I would try and load it into a movie clip etc but i was hoping there is an easier way, as I dont have time this isnt really my job anyway? Also If I load it internally I will have to try and explain to some technophobe to keep the files linked.
Cheers
Reversing The Orientation Of A MC
Hi,
I want a game character to face the opposite way when a key is pressed. I currently set the mc.scaleX value to a negative value. Its not a very elegant solution! Wondered if anyone could suggest an alternative method please!
Thanks Dan
Code:
stage.addEventListener(Event.ENTER_FRAME,setDirection);
function setDirection(e:Event):void
{
if(leftArrow)
{
if(forwardFacing)
{
characterSprite.scaleX= -0.3;
forwardFacing = false;
}
}
if (rightArrow)
{
if(!forwardFacing)
{
characterSprite.scaleX = 0.3;
forwardFacing = true;
}
}
}
Print Orientation
I am working on printing a 'certificate' from Flash and I would like to have it print landscape. Here is my code so far:
on (release){
var pjOutput:PrintJob = new PrintJob();
if(pjOutput.start()){
pjOutput.addPage(_root,{xMin:0,xMax:750,yMin:0,yMax:550},true,1);
pjOutput.send();
}
delete pjOutput;
}
Works fine printing portrait, but I cannot figure out how to spin it to print it landscape. Any ideas?
Thanks is advance!
PrintJob Orientation
This is just not working, has anyone had any result using this, I've got
ActionScript Code:
function dazprint(){
var pageCount:Number = 0;
var my_pj:PrintJob = new PrintJob();
if (my_pj.start()){
// Print entire current frame of the _root movie in vector format
if (my_pj.addPage(0, {}, {printAsBitmap:true})){
pageCount++;
}
}
// If addPage() was successful at least once, print the spooled pages.
if (pageCount > 0){
my_pj.orientation == landscape;
my_pj.send();
}
delete my_pj;
}
everything works well except the orientation
Object Orientation Question
Hey all,
I was just working on a project and was cursing that every 'x' and 'y' value that i enter into the info panel is "upper left associative". Meaning if you entered x=100 and y=100, the top left corner of your object would go to that location.
Now i i thought i remember (so far back that i cant rememeber what version this was) that an earlier version of flash USED to align the object in terms of its center. I have a good feeling that this feature can be switched, i was just wondering how to do it
Any help would be appreciated, thanks!
Andrew
|