First off, this is an Actionscript 3 question.
Okay, this is a bit complicated to explain, but I have been searching for a way to make an invisible button, when highlighted, control a movie clip. I have images inside this movie clip that are all separate. When the mouse hovers over the left invisible button, the images scroll right. When the mouse hovers over the right invisible button, the images scroll left. Im unsure if reversing the frames is even possible, or maybe even if you can divide the 120 frames (with the 60th frame being my start) and making the mouse move back by math form? Either way, they are images and buttons. Is there any way of doing ANYTHING like this, even if it means math form, frame form or making the images animate individually and move into positions?
Cheers,
- Jesse
Not entirely sure what you mean, but it sounds like you're trying to go back 1 frame?
[movieClip].gotoAndStop([movieClip].currentFrame - 1);
This would do that I guess. Feel free to comment if that's not what you're looking for.
Related
I'm wondering if there's a way to animate a gif or video based on where my mouse is hovering in relation to the frame.
I think the best example of what I mean would be, if the gif is of someone turning around 360, I would want the person to be facing forward when the mouse in on the left of the frame, turned around when in the center of the frame, facing forward again when at the right of the frame (and all the in-betweens).
Effectively, using a mouse hover as a drag function for a video timeline
Let me know if you have any ideas or if you need more details.
If need be, I can upload some example gifs/videos to clarify my purpose.
Thank you all so much in advance.
You can use transform: rotate() on a class in CSS.
Here is demo.
I would like to ask you about my problem.
I have two different scenes and when i change from second scene to first scene, text from second scene is still staying visible and does not disappear, how it should. It is maybe hard to discribe, but i really dont know what to do with this...
I have an html5 page where I need to develop a small test. There's 2 columns with several buttons and whenever you click on one and drag the mouse, a line follows the mouse movement until it's released, snapping to the next button or getting erased.
I'm using divs for the buttons, since this is to be later delivered to a design crew and they need to be able to change images, texts and placements with css.
My problem is with canvas. I can't place it over the divs, so they don't cover the lines. I've tried svg too, but it has the same problem.
A coworker found the answer. Apparently I needed to use position AND z-index on the css for the canvas to be placed on the layer properly. Go figure
I decided last week that I wanted to play around with the Canvas. I am making a simple webapp (at my daughter's request), where there are ponies, and you can add them to your own picture and move them around.
I already have it so when a button is pressed, a picture of a pony comes up on the canvas.
My question now is, what is the best way to move multiple images when they are already on the canvas?
It would be great if I could drag them each, but I can only find tutorials using KineticJS, and I cannot get that to display how I want.
So, are there any other dragging images on Canvas tutorials out there?
Otherwise It would be okay to use keyboard buttons, but I cannot figure out how to do that with multiple images. When I use keyboard buttons, it moves all images at once.
Any ideas?
You have to keep track of where you draw each one, clear the entire canvas, and redraw each and every one of them (presumably moving some of them in the process).
None of this is built in to Canvas. I have a tutorial on making the Canvas interactive that covers keeping track of, placing, and moving (selecting) shapes on a Canvas. There's a live demo on that page and source code at the bottom of the article.
my questions is little similar to some of the questions asked previously about overlapped sprites/movieclips like this. But my requirement is slightly different than them.
I want to handle the mouseevents for all the sprites on the stage including the one those are hidden behind (or overlapped or occluded) and the main condition is that I want to handle the occluded sprite (that hidden behind other sprite). example, say I have sprite1 and sprite2 on stage and I want to start drag whenever i click on the sprite and stop drag after another click.
This can be done easily, but the problem and my main requirement is that if I drag the sprite1 and drop it exactly on top of the sprite2 then sprite2 will be hidden behind the sprite1 I wont be able to drag the sprite2 without moving the sprite1 first. if you have played zynga's empires and allais game on facebook, it is handled seperatly, it is how it works in that game, the mouse event is triggered on the sprite behind the overlapping sprite, if you have two sprites overlapping one sprite than the mouse event is triggered on the sprite which is last and not the one in front irrespective of whether there is only one sprite overlapping or two or three and this happens to irregular shaped sprites (not just rectangles)
if any one can give me hit on how zynga might have implemented this or help me find out how to achive it it will be great help
thanks
One possibility is that the game is not listening to the click events from each separate sprite.
When programming games, you often implement a grid system. If this is the case, the programmer has a record of where all sprites are placed on the grid. The programmer could then listen for a click on the entire grid renderer and work out the selected object by referencing the mouse position against the grid records.