Sliding MC Across X Axis +PLEASE HELP+
OK, I'll try to make as much sense as possible...
I have a movie clip whose position along the x axis is controlled by buttons at the top. The buttons actions for moving my movie clip are as follws:
on (release) (
_root.movieclip.xpos = 100;
)
I need 2 more buttons which tell my movie clip to go forwards or backwards by 750. My buttons tell the movie clip EXACTLY where to stop along the x-axis,
but I can't seem to figure out how to tell my movie clip to slide along in the same way by 750 at a time.
This is the action attatched to the movie clip which gives it that sliding effect...
onClipEvent (enterframe) {
Xsquare = _root.movieclip._x;
Xdiff = Xpos - Xsquare;
Xmove = xdiff/6;
_root.movieclip._x = Xsquare+move;
updateAfterEvent (enterframe);
}
Any help would be greatly appreciated.
Thanks so much
-Justin
FlashKit > Flash Help > Flash ActionScript
Posted on: 06-27-2001, 03:05 PM
View Complete Forum Thread with Replies
Sponsored Links:
Sliding Stuff On X Axis Vs. Y Axis
hi everyone,
i did a tutorial on sliding menus from the kirupa site, it's here: http://www.kirupa.com/developer/mx20...ith_slider.htm
i've made a lot of great stuff with it, my menus are sliding all over the place as we speak, but only on the x axis.
now i'm trying to make one that slides up and down on the y axis, and i can't get the coding to make it work right. i have seven buttons this time instead of 5, and i've changed all the "x's" in the actionscript to "y's"
it still slides along the x axis!!!!! what's going on. does flash not like using the y axis. perhaps this is impossible?
this is the code, maybe someone can tell me what i'm doing wrong?
easeSpeed = 5;
slider_mc.onEnterFrame = function() {
this._y += (yMove1-this._y)/easeSpeed;
};
button_1.onPress = function() {
yMove = button_1._y;
};
button_2.onPress = function() {
yMove = button_2._y;
};
button_3.onPress = function() {
yMove = button_3._y;
};
button_4.onPress = function() {
yMove = button_4._y;
};
button_5.onPress = function() {
yMove = button_5._y;
};
button_6.onPress = function() {
yMove = button_6._y;
};
button_7.onPress = function() {
yMove = button_7._y;
};
View Replies !
View Related
Sliding MC By Along An Axis
I have a couple of sliding text boxes on my Flash site. Each 'frame' on the slider is accessed by clicking on an up or down arrow button. This works fine with the code pasted below if there are only 2 frames. I've used y positioning in this case. However, what code should I use to slide along the axis by a certain amount of pixels rather than to a specific y position? Let's say I want the MC to slide 315px up or down rather than to 315, 0 or -315 on the y??
Also, when the slider is in the top or bottom position (ie, when there's no more frames of info to slide to, how do I make the up or down arrow button inactive so that it doesn't just keep sliding?
Thanks for your help.
import fl.transitions.*;
import fl.transitions.easing.*;
function slideAbout(yPos:Number){
var aboutSlide:Object = new Tween(aboutSlider_mc, "y", Strong.easeOut, aboutSlider_mc.y, yPos, 1, true);
}
function downAboutClick(myevent:MouseEvent):void{
slideAbout(-315);
}
this.downAbout_btn.addEventListener(MouseEvent.CLI CK, downAboutClick);
function upAboutClick(myevent:MouseEvent):void{
slideAbout (0);
}
this.upAbout_btn.addEventListener(MouseEvent.CLICK , upAboutClick);
View Replies !
View Related
Sliding Menu-x And Y-axis
I followed the tutorial on sliding menus and now I am trying to get the menu to slide vertical as well as horizontal. I have tried to just add y-axis code wherever a x-axis code was, but that cancels out the code that positions the chosen 'box' in the mask area.
So any suggestions/tutorials would be great on how to get around this.
Also if i do get it working i'll post the code here so others can have it, but i first need help to get it working.
View Replies !
View Related
X Axis, Y Axis, Location Problem
Hello Friends,
I am having an alignment problem.
I have 5 buttons (actually they are pages of text turned into to buttons), my stage is 780x420. I have the first page (their size is w=109.7 h=151.8) coming in at x=379.7 - y=291.8 on the stage, I am using motion tween to get the first page to point x=59.9 - y=291.8, thats fine, now, I want to put a movie clip in the over state of the button that when the mouse moves over the page, the page will move back to center and go from 25% (which is the height and width of the page now) to 100% on of its size.
Ok
So, when I am setting up my movie clips motion tween in the edit stage of the movie, I use the same coordinates as the actual page has on the stage (stage size is the same), but when I put the movie together, they don't line up and it just goes crazy on the stage. I have a "stop" action on the last frame of the movie clip but still don't work properly.
Any advice would be appreciated
Thank you
Thorrax
View Replies !
View Related
Slideshow: Sliding Images. Repeat Sliding After Last Image
Hello.
Scenario:
I have 5 images. With a setInterval I slide the images - back-to-back - from left to right under a window (mask). When the last image is under the mask, I'm trying to figure out a way to start over again. So that when the last image is sliding out, the first image is sliding in, thus retarting the slideshow.
I figured the best way to do this is to 'move' the image that last moved out of the mask before the other images. So if im1 move out of the mask, im2 move into the mask, im1 would move to position itself after im5 (since I have 5 images.)
The problem. How to tell flash to move the image that slides out to move to a position after all my images.
im5-im4-im3-im2-im1 becomes im1-im5-im4-im3-img2
Each image is 80 pixels wide.
Any help is much appreciated.
Thanks,
/Flip
View Replies !
View Related
Sliding Menu - Need MC To Play After Sliding Has Finished
Hi,
I have created a Sliding Menu with about 12 sections. In one of the section/s I have a MC inside that I want to play. Is there a way to tell a MC to play once sliding has completed? Say based on pixel position (of the sliding MC) or something similar?
At the moment I'm using "on release" but with this method, the animation starts too early. (By the time you slide from section 1 to 12 the MC has already started playing)...
Any ideas?
Thanks in advance!!
View Replies !
View Related
Sliding In/sliding Out Images Using Actionscript
I know I should probably know how to do this by know but I'm stuck.
How do I create this effect using Actionscript?
http://synap-sys.com/in_out_slide.html
When a user clicks on button "1" the image slides in from the left. When the user chooses to view image "2" image one slides out of the way and image two then slides in. I would like to do this using Actionscript because there's going to be a bunch of pictures that are part of this slideshow. It's how to tell the Flash player how to slide out the current image and slide in the new image that I'm struggling with. Forgive my lameness.
I'm also trying to do this without dynamically loading each image everytime they click on a button. The reason for this is so all the images load at once, thereby eliminating the delay that would occur as each image loads after a user clicks a button. A fellow Flashkit member(Garbage) suggested I do this using a Library clip (all the images placed on a keyframe of a movieClip that are referenced per button click) but I'm not sure how to do this (goToAndPlay?).
Any help or guidance would be most appreciated.
I've attached the .fla if anybody wants to look at it.
Thanks
Adam
View Replies !
View Related
Sliding Nav ( Can You Make It Stop Sliding)
*USING FLAH MX
Hello Im having some issues trying to get this sliding nav to stop sliding.
I was referenced this file
http://www.flashkit.com/movies/Scrip...y-87/index.php
It seems to be controled with a button called tracker but I cant get the nave to stop sling on roll out (also the text fields in this fla are not needed)
The effect I want to achieve can be found on this site
http://www.theopiumgroup.com/index2.html
If you click mansion and then click info you will see how they set up there sub navigation
Any help would be great,thank you in advance
View Replies !
View Related
[F8] Sliding Interface With Sliding Buttons
I'm trying to get a sliding interface going with the buttons (that move the interface) moving along with it.
At the moment it looks like this: http://www.flashvista.com/details/item/746/
I got there by following by following the first page of this:
http://www.peachpit.com/articles/article.aspx?p=26319
Basically I want to encorporate the buttons with the interface images.
I tried putting the buttons in with the images_MC, but nothing happens with you click the button.
Whats the easiest way to make this work?
thanks
View Replies !
View Related
_x And _y Axis?
Hello all,
I have to load an external .swf into my movie...but i cant seem to get it to load in the spot that I need it.
loadMovieNum ("correct.swf", 1)
I know it has to do with _x and _ y but I cannot get it to work...any ideas?
Thanks
Aron
View Replies !
View Related
Z Axis
I also am new to animation. I am trying to animate text by moving it along a z axis. The closest to this would be in the start titles of all Star Wars movies eg
Episode IV
A new hope
It is a time of turmoil etc.
In this title, the text appears to slide in from the bottom, changing its X axis as it does so thereby making it smaller. However the slide looks to me as if it is a 3D effect moving along the Z axis rather than the Y axis. I can't see how this is done with Swish. Any help would be appreciated.
Thanks
Ross
View Replies !
View Related
Cannot Seem To Get The Y Axis Value.
please look at the first graph.
i am trying to get the _y value of my mouse when it is roll over the graph. It will reflect the _y value i set for the graph. I should also get value like 95.5, 73. i have settle the x axis but just can figure out the _y value
View Replies !
View Related
X Axis Help Plz
ran in to a little bit of a problem maybe someone can help... i tried to attached the fla below but my zip file is bigger then 500k and it wont let me post it here.. i am trying to make the 3 buttons at that top scroll through the man images using actionscript
on(release){
_root.images_mc._x = -2; // coorrordinates change for each button
}
but when i click the buttons they jump to each co ordinate on the mc instead of smoothly scrolling through the mc... if that makes any sense to you
if someone could help out that would be great thanks guys
View Replies !
View Related
Cannot Seem To Get The Y Axis Value.
please look at the first graph.
i am trying to get the _y value of my mouse when it is roll over the graph. It will reflect the _y value i set for the graph. I should also get value like 95.5, 73. i have settle the x axis but just can figure out the _y value.
below is the link to my.fla http://s31.yousendit.com/d.aspx?id=3...Y3GT8GPQVA0OJF
i tried delete the unnecessary stuff but still cannot upload into the server here.
please do PM if you need to send the file back to me as i will PM you my email address .. .sorry for the inconvience.
View Replies !
View Related
Cannot Seem To Get The Y Axis Value.
please look at the first graph.
i am trying to get the _y value of my mouse when it is roll over the graph. It will reflect the _y value i set for the graph. I should also get value like 95.5, 73. i have settle the x axis but just can figure out the _y value.
below is the link to my.fla http://s31.yousendit.com/d.aspx?id=3...Y3GT8GPQVA0OJF
i tried delete the unnecessary stuff but still cannot upload into the server here.
please do PM if you need to send the file back to me as i will PM you my email address .. .sorry for the inconvience.
View Replies !
View Related
Z Axis
I keep seeing these sites that use the z axis to simulate real-world depth perspective. Here are some examples:
http://www.flowersforhope.com
http://www.rpa.com/
Can someone please direct me to where I can learn this technique? Or at least give me a hint as to how its done?
Thanks!
View Replies !
View Related
Z Axis
I keep seeing these sites that use the z axis to simulate real-world depth perspective. Here are some examples:
http://www.flowersforhope.com
http://www.rpa.com/
Can someone please direct me to where I can learn this technique? Or at least give me a hint as to how its done?
Thanks!
View Replies !
View Related
Point To Axis Help
ok to expand on what I mean..
I'm trying to create a basic function where when i press a button my points move to random positions on the screen.. ok got that worked out.. now I want to add lines inbetween the points but i have no idea how i would make them move and stretch with the points.. if anyone can help I would be most thankful!
View Replies !
View Related
Revolve On Y Axis
i am in need of assistance in the animation of a 3d menu item. i have a ~ 1"x1" bible that i want to spin on its Y axis while in mouse rollover state.
i cant think of anyway to do this with a motion guide (am i wrong?)
creating a motion tween and having the book in its regular state at the first keyframe than choose modify>transform>flip horizontal at the last keyframe wont work because it will only appear to spin 180 degrees than flip back 180 degrees as opposed to spinning 360 degrees continuosly.
so im hoping there might be a way to do this with AS but I cant find anything in my foundation AS book or online.
any help would be greatly appreciated.
thanks in advance,
>>kyle
View Replies !
View Related
Behaviour Of Z-axis
I'm doing a 3D application using Flash. I need to introduce the z-axis to my current script. I have a few questions. For z-axis, are points nearer to you positive or negative? Also, when the z-coordinate of one of my movie clips is changing constantly, I need to change its size too, to give an illusion of 3D. How do I change the movie clip's size according to its z-coordinate? Use x-scale / y-scale? Can give an example? Thanks in advance!
View Replies !
View Related
Rotating On Axis
Hello once again! Hope all is well. I am having a problem with rotating a circle. Now I know that if you draw a flat circle and put a rotate on it, it would'nt look like it is rotating, So I added some lines to it, and a sphere in the center. When I add a rotation on it, It does'nt spin on its axis. You can see it move slightly off course. Now the circle is perfectly round, not oval. Can someone help me with rotating this circle in one spot on its proper axis.
View Replies !
View Related
Axis Rotating
can someone give me a step-by-step explanaition of how to make a graphic or text rotate around it's own axis (diagonally, horizontaly, vertically etc.). i know this is a common and easy thing...i'm just very new to flash.
THANX!
View Replies !
View Related
Limit Y Axis
After a too long of a break I'm trying to learn Flash all over again.
Here's a run down of what's what. Movie height of 200 with a dragable MC that has a height of 250. At the start the y axis of the clip is -25.
This is the code I'm using for moving the clip up and down
y = getProperty("/hidden", _y);
offset_y = (start_y+y)/16;
cur_y1 = getProperty("/movie1", _y);
setProperty ("/movie1", _y, Number(cur_y1)+Number(offset_y));
I want the clip to movie either up till the y axis = -50 then go no higher or have the movie go down until the y axis = 0 then go no lower.
I've been looking for the answer for a while and have tried a half a dozen things with some funny results and I'm sure it's an easy thing.
Can anyone please point me into which scripting commands I need to look at to learn how to do this?
View Replies !
View Related
Setting Z-axis?
I have three movie clips on the same layer on the _root level. These movie clips may or may not be visible (depending on the user), but if all three are visible at the same time how do I set the z-axis so whatever one the user clicks on come to the front. I tryed a javascript focus()(movieclip.focus() method, but I couldn't get it to work. Anyone have any suggestions, it would be greatly appreciated.
View Replies !
View Related
Question About X Axis
hi i have a problem, i am mirroring this website
http://www.signumprojects.de/
for learing purposes. and iam stuck at this point
u c the little triangle above the mouse moving on x-axis which moves when u move the mouse i dont know wut the code for that is, can some one help me out thank u
some one wrote me this code but it doesnt work
"make a triangular shape, turn it into MC.
Put a code:
code:
onClipEvent(enterFrame){
this._y=_root._ymouse-15; //set it higher than mouse by 15
this._x=_root._xmouse; // set the _x of triangle as the mouse's
}
"
thanx u
View Replies !
View Related
HELP Backwards On X Axis?
Ok, here's my problem, the following code is used to randomly scroll symbols from left to right on the x axis at random speeds, sizes, transparency's and at random heights on the y axis.
onClipEvent (load) {
a = random(100)+50;
_x = Math.random()*750;
speed = Math.random()*5+1;
_y = Math.random()*300-(_height/2);
_xscale = a;
_yscale = a;
_alpha = Math.random()*30+40;
}
onClipEvent (enterFrame) {
b = random(100)+50;
_x += speed;
if (_x>=750) {
_xscale = b;
_yscale = b;
speed = Math.random()*5+1;
_y = Math.random()*300-(_height/2);
_x = _width*-1;
_alpha = Math.random()*30+40;
}
}
But I want to scroll the symbols from right to left. When I change these lines, speed = Math.random()*5+1;, to speed = Math.random()*-5-1;, it works but it does'nt loop like is supposed to. Go to http://www.isometricshadows.com/movi...m_movement.swf to get an idea of what i mean.
View Replies !
View Related
Can Someone Help With Axis Problem?
Ok...heres my problem...
I want to make an MC follow a mouse to a button when the button is in the over state and then ease out when the mouse is off the button...if someone moves their mouse over a different button I would like for the MC to move over that button....and etc.
I can limit the MC's movement to one axis...thats not a problem. But I cant get it to only move when the button is in the over state...in fact I have no clue how I would go about doing this. And then the easing out is another issue because I dont know how I would do that either.
If anyone can help I would be much appreciative.
Thanks,
Sean
View Replies !
View Related
Rotate Using Specified Axis
Hey,
How do I tell an object to rotate along a specified axis? I did "edit center" and while it rotates just fine using the rotate tool in the toolset, the _rotation script rotates it using the original center.
any help would be greatly appreciated
View Replies !
View Related
Mouse Axis
I am a user of flash 5 and was wondering how I could program an graphic object to move down in response to the mouse moving up, moving left in response to the mouse moving right, etc. Thank you in advance.
View Replies !
View Related
Rotating On An Axis...
I developed a short intro for a site, and am sure I did it the hard way... look at the link below ( http://www.mdredlinerz.com/ ) and in the intro you'll see the rpm needle moving... I did it by cutting and pasting and manually rotating each frame so that it looked "about right" .... I'd like to, however, learn how to be able to have the needle rotate on an axis of a pre-deignated axis point, either using the tools within flash, or action scripting. Any help with this would be greatfully appreciated. Thanks in advance...
RC
View Replies !
View Related
Rotate Around Y Axis?
Is it possible to rotate text (or any graphic symbol) around the y axis in Flash MX, as shown in frames 75-138 of this movie?
http://www.flashkit.com/movies/Effec...-358/index.php
Or is this accomplished with a program like Swish?
Thank you.
View Replies !
View Related
Tooltip Y Axis
Using this tooltip function
code:
function homecaption (string) {
xmouse = getProperty("", _xmouse);
ymouse = getProperty("", _ymouse);
duplicateMovieClip ("_root.tooltip", "homecaption1", 1);
homecaption1.homecaption = string;
setProperty (homecaption1, _x, xmouse);
setProperty (homecaption1, _y, ymouse);
startDrag ("_root.homecaption1");
homecaption1.gotoAndPlay(2);
}
function remove_homecaption () {
stopDrag ();
removeMovieClip ("homecaption1");
}
i want the Y axis to remain at a certain position, but allow the X axis to still follow the mouse!
Anyone shed some light?
Anotherthing How do you put code into the "code" quotes rather then how ive done it using the ordinary quotes thing on this message board?
EDIT: I fixed your post to use [ as ] tags - edit your message to see what they look like. - jbum
View Replies !
View Related
StartDrag And The Y Axis Help
Hi there, is it possible to drag a movieclip only along the y axis?
I presume it has something to do with tricking the clip into thinking the stage doesn't exist on the right or left but how can I achieve this.
Thanks - itchyjam
Here's is my current code;
on (press) {
startDrag(this);
this.swapDepths(100);
}
on (release) {
stopDrag();
if (this._droptarget=="/gear2") {
setProperty(this, _x, 440);
setProperty(this, _y, 285);
_root. nav_mc.gotoAndPlay("menu1");
} else if (this._droptarget=="/gear3") {
setProperty(this, _x, 440);
setProperty(this, _y, 265);
_root.nav_mc.gotoAndPlay("menu2");
} else {
setProperty(this, _x, 440);
setProperty(this, _y, 300);
_root.nav_mc.gotoAndPlay("menu3");
}
}
View Replies !
View Related
Relative Y Axis
please help this noob figure out actionscript (flash 5) for the movement of one symbol's y axis to affect another symbol's y axis automatically. i only want the movement of one to affect the other, and not both. so, if a is the controlled, a moves down, and b moves up ; if a moves up, b moves down.
View Replies !
View Related
X & Y Axis Basics
Hi all,
I already posted this but I can't find it so I do apologise if you find it else where.
I'm wondering if someone can please explain the x&y axis?
What is it used for?
How do I map it? ie- how do I know where the numbers correspond to what area on the movie?
I'm guessing I can use it to define a mouse roll over point?
ANy help you can give would be greeeeeeatly appreciated!
Thanks in advance
View Replies !
View Related
Reflection In Y-axis
I'm trying on an exercise that need to check whether the new position of an image is correctly reflect in the y-axis.
The basically of this exercise is:
Let say there is an object (a dot) at coordinate (2,3). When I click at a new position, a new image of the original object will be flipped at the new position there. So in order to check whether the flipping object is correctly reflected in y-axis, what should be done? Hope someone could help me out. Thanks in advance.
View Replies !
View Related
Scrolling Axis Help
ran in to a little bit of a problem maybe someone can help... i tried to attached the fla below but my zip file is bigger then 300k and it wont let me post it here.. i am trying to make the 3 buttons at that top scroll through the man images using actionscript
on(release){
_root.images_mc._x = -2; // coorrordinates change for each button
}
but when i click the buttons they jump to each co ordinate on the mc instead of smoothly scrolling through the mc... if that makes any sense to you
if someone could help out that would be great thanks guys
View Replies !
View Related
[CS3] Locking The X Axis
hi all
i'm following a platform game tutorial at the mo but the camera tracks with the character along the x axis but not the y axis.
i want my game to scroll up with the character and lock the x axis in place because as it is you can jump off the top of the screen and disappear while you can also walk off to the side and just see blank non-game screen
thanks
View Replies !
View Related
Designing With Z Axis
Does anyone know how to design sites that use the z axis like this example: http://www.billyharveymusic.com ? Any tutorials or advice on how to zoom in and out like this site does. I am not even sure what to search for right now. Thanks
View Replies !
View Related
Imaginary _z Axis?
After my last post about depths... it actually never worked. I thought it did, but I tried it on another button and well it just grew and kept on growing!?
So I was wandering if there was a _z axis... thus instruction the button to come to a higher layer. I can imagine if theres say, 10 movie clips on the layer, then each one will have a z coordinate... so rather than using swap depths, which doesn't want to work, instead you tell it which _z coordinate to go to.
Does this make sense?
View Replies !
View Related
AI, Problem With Y Axis
Im new to actionscript and flash so please dont get frustrated if anyone could help me out with a problem im having I would be very thankfull if you open my zip and in the actions of my badguy pencil is the part of my code I need help with Logicaly it's Y axis should add by 40 every frame when its x axis and my players x axis meet but it doesnt seem to work please help me
View Replies !
View Related
How To Set The Axis Values
Hi all,
I am running on one serious problem in my graph project..
please Anyone can helpme out.. i am attached my source file here for your kind persual.
In this i am statically display the x and y axis values in textboxes..k..
i mean 20,40,60,80,100...... like this..k..
in my xml file , there are 2 graphs.. each graph have their x and y values..k
i want to find the max value and set the x and y axis values ...
hope you will undersatnd my expectation.. right..
any help will be appriciated..
Thanks in advance..
View Replies !
View Related
|