How to make it go and play a frame on main timeline when movieclip finishes without using a button? - actionscript-2

If I have a movieclip already in a frame how do I make it go and play another frame on the main timeline once the movieclip is finished without using a button

On the last from of your movieclip, add a new keyframe and the following actionscript.
_root.gotoAndPlay(25);
or
root.gotoAndPlay("whateverFrameLabelName");

Related

codename one how to place component on an image viewer that capture camera?

I have a GUI Builder created form in codename one, how can i open the camera in a resizable view at the show() of the form and place container like text area or anything else on it?
I saw the camera demo but i don't understand it very well because on the simulator it open a file picker.
My purpose is to create a form with a camera resizable capture when you have two labels and you can also write or paint on your photo used in background, I do this only for hobby and fun, i do what i can, Any advice is well accepted, thank you for the attenction
You can now place a component on top of a camera view with a new cn1lib: https://github.com/codenameone/CameraKitCodenameOne
Original answer below:
I'm assuming you mean overlay on a live camera view. While this is possible it's not supported at this time in the Java API layer.
If you mean grabbing a photo and setting it as a background for the form for overlay you can create an image with the result of the Capture API and use setBgImage() to set that image to the background of a component or form.

I want to Click , Drag and Move a button on the pygtk window

I managed to find a sample code for Images as described in the following link .
How to drag images with pygtk
However when I use it for a button doesn't seem to work .
What the original link does:
It moves (pans) the image inside a 'Scrolled Window' widget. The widget doesn't change places, only the image with respect to the widget.
If you want to move the button itself, that is more complicated! It is easier if you use the 'fixed' layout manager, where the buttons are located in absolute coordinates (as opposed to the 'normal' layout manager where all widgets are 'packed' alongside each other. There you should use drag and drop. You have to prepare the entire application for 'receiving' the button, and what to do with it when it gets there. This involves many steps! ).
Have a look at the gtk.Fixed widget's documentation.

SpriteKit scene/node on top a paused scene

I'm trying to add a scene/node on top of a paused scene with a transparent background so the active scene view will still be visible.
I pause the scene with scene.view.paused = YES; but that means that everything is paused but the update method.
With Cocos2d one could easily push a new scene on top of an existing one but unfortunately SpriteKit does not have this capability.
Is there a way to pause a scene and add an active scene/node on top of it ?
A solution I've tried :
Creating an additional view controller with the pause-scene content and present it via the active view controller when needed but the background is always black so transparency is not achieved and some other problems occur with the original scene (I'll elaborate on these if needed).
It's all there. You do not have to present a new scene or view.
In a nutshell:
Pause the node where your game content is on that you want to pause. If you do all the processing in the scene class you'll have to refactor it, I'm afraid. The key is having a SKNode that acts as your "game layer" so that you can pause just that particular node. If you receive update: and other regular method calls to the game layer, it should check its self.paused state before doing any processing.
When you have that, pause the game layer node which will pause all the nodes and actions in it.
Now add another "layer" node with whatever UI you need to the scene. That could be your game over or pause layer, and it will be perfectly happy to receive input and run actions while the game layer is paused.

Please put me on the right track with Drag Drop on IOS

I am creating a bit of a video mash up app (like imovie) and the first function I am tackling is the ability to drag a thumbnail from a video library and drop it on a time line. I was able to add the drag code to the video thumbnail class so when you touch it, it creates a drag proxy view which moves around when you move your finger. Next I want to be able to drop it on the time line.
My Timeline is also a uiview and I am unsure of how it can receive notification that the thumbnail is being dragged over it! It will need the position of the thumbnail so that it can show it on the timeline and the duration of the clip and such (information that I have attached to my video thumbnail object)
How would you approach this issue? The App is for ipad and is on ios 5.
Thanks for any pointers!
You will most likely want to subclass the UIView. You can look at this post:
https://stackoverflow.com/a/4130641/1535038
Mainly you will want to see if the My Timeline view is being touched, and then see if you are in the middle of a drag or not.

Reverse animation before it is finished

I have a button and when the user touches down and holds a popup appears. However, when the user releases his thumb before the pop animation finishes I'd like the animation to stop where it is and autoreverse to the initial position. How can I accomplish this?
Currently I'm simply using UIViews -animateWithDuration:animations:completion:. Do I have to set the animations explicitly in this case?
I've already tried reading the current state from the presentationLayer properties, but that somehow didn't work.
You can start the second animation using the UIViewAnimationOptionBeginFromCurrentState option. This will stop the first animation if it's still running.