Adobe Flash start animation - animation

I have some symbols in my flash project. It's a chemistry elements. It's pathes looks like
Scene 1->elem h
Scene 1->elem he
Scene 1->elem li
When i click one of this elements its play their animation - element zoom in. When i clicked on zoomed element - its zoom out. I need if i zoom in the element, all another elements zoom out (if their zoomed ofcourse).
The question is how to start symbol animation from another symbol.
I use Adobe Flash Professional CS5.5 and action-script 2

On the main timeline, you want to create 2 functions:
function resetAllClips()
{
// Some loop/code to reset all clips
}
function zoomClip(clip)
{
// Reset Everything
resetAllClips();
// Now Zoom in
// ... your code for zooming ...
}
Now you attach an click handler on each of your clips and call zoomClip(clipinstance);
All your code can reside on the main timeline.

Related

Drag to resize a bitmap with createJS & Canvas

I'm working on a basic design app where the user can upload images to a canvas, drag them around and resize them. The problem I have is resizing the image with a mouse drag. I'd like the user to position the mouse pointer on either corner of the bitmap image and drag either towards or away from the bitmap to resize it proportionally. I'd be grateful for any code or suggestions.
Lanny mentioned that you had this question here. ZIM, which is based on CreateJS has this functionality built in - it is called transform(). We also have an uploader built in called Loader().
Here is the code that you would use inside the ZIM template available on the code page at ZIM https://zimjs.com
const loader = new Loader().center();
loader.on("loaded", e=>{
e.bitmap.center().transform();
// or if you want multiple files
// loop(e.bitmaps, bitmap=>{
// bitmap.center().transform();
// });
loader.removeFrom();
stage.update();
});
Below is an image that has been loaded. You can try it here https://zimjs.com/explore/uploadresize.html. The transform interface will go away when the user clicks off the image and then comes back when they click on the image. There are various options for all of this that you can read about in the Docs available on the ZIM site.
All your regular CreateJS will work and you will find that ZIM is helpful in many other ways too! Aside from transform() there is drag() for normal dragging, and gesture() for pinch zoom and rotate - you would use one or the other of these not combined.

Unity short Black Screen after loading first scene

Scenes:
1.Splash,
one image with the IEnumerator Start() code as described below.
2.Menu,
Canvas UI with a few buttons and a some gameobjects in the scene as background. Camera has a tonemapping and depth of field script.
Stats: Batches 96, tris 20.4k, 41.5k
3.Main
Main scene of the game.
Bug, happend on android device and on pc in the editor:
1.Splash scene loads the menu scene using:
IEnumerator Start()
{
AsyncOperation async = SceneManager.LoadSceneAsync("Menu");
while (!async.isDone)
{
yield return null;
}
}
2.The canvas UI of the Menu scene appears with a black background, the gameobjects in the scene are not visible, for a few seconds.
3.The canvas UI + the scene is visible.
Same bug happens when the Menu scene is loaded from the Main scene.
Unity version = 2017.3.0f3
Using vuforia in the main scene.
EDIT:
I disabled all the objects and camera effects in the Menu scene except for a plane and the canvas, the canvas still appears a few seconds before the plane.
To describe the bug better, the camera seems to active a second after the canvas UI is shown.
EDIT2:
I created a new camera in the menu scene and the problem still persists.
I found my fix by adding an AR camera to the scene and disabling the the VuforiaBehavior component which was making the black screen when the scene was loading.
In my case, I just had checked Split Application Binary in Publishing settings to be able to upload my game to Play Store. (Play Store does not accept apk files to be bigger than 100mb, so you split your big apk into a smaller apk & a obb file)
However, if you do that, you need to put both your .apk and .obb files to specific folders in your phone, when you are manually testing the game.
.obb needs to be in a specifically named folder, with a specific name, as explained here: http://graphicdna.blogspot.com/2017/06/manually-copying-unitys-apk-and-obb.html
Shortly, name should be in the format:
main.[FIRST_PART_OF_VERSION_NUMBER].[PACKAGE_NAME].obb
Where [FIRST_PART_OF_VERSION_NUMBER] is the highest digit of the version number you can find in the Player Settings. For instance, if your version is 1.0.0, [FIRST_PART_OF_VERSION_NUMBER] is 1.
And [PACKAGE_NAME] is the package name specified in the same screen, right above the version number.
The game will expect to find that OBB file in a location like:
[INSTALL_LOCATION]\Android\obb\[PACKAGE_NAME]
Where [PACKAGE_NAME] is the same value described above, and INSTALL_LOCATION refers to whether the game is installed in the internal memory or the external SD-Card (this depends on your own settings).

easeljs images blinking when updating

I'm using easeljs in order to control my CANVAS.
And I'm trying to make animation by changing images, but not using spritesheet.
But whenever images are changed there is time lag( like blinking)...
How can I remove blinking not using spritesheet?
My guess (until you provide code), is that the image is being loaded during this gap, that's why you see a blink, and this is because you are loading the image in the same container (meaning the place where the image is loaded/displayed).
The solution to this is to use 2 containers, one in the top of the other; you have the first image loaded, and when you load the next image, you set a complete event on that second image, and when the second image loads, you remove the first one.
In the end you will have to create a class to manage both images and their events, this because if you are trying i.e. creating an image rotator, you will have to swap the bottom image loaded to the top, to make a smooth transition, and/or to add an alpha tween.
This is a very simple outline:
Container
topImage
bottomImage
this.addChild(topImage)
this.addChild(bottomImage)
bottomImage.on("complete", function(){
//add effect to top image (fade out)
//load image into top image
//fadein effect
})
topImage.on("complete", function(){
//first time you have to add an fade in
//but you can remove the event after that
})
this.load = function(path){
bottomImage.load(path)
}

Unity 3d show specific frame of animation

I'm trying new unity 3d options for 2d games. I'm trying to create background that changes depending on actions i made. So if i press button one i get sprite one as background and if two i get sprite two. Since I have 32 options, I figure out the best way would be to have an Animator, that changes frame depending on button click. So i created animator and animation. But the problem is I can't set time to where to stop animation to show selected frame.
I'm trying like that:
Animator ani=background.GetComponent<Animator>();
ani.animation["field_back_anim"].time=0.5f;
ani.speed=0;
But it fails at second line with that error:
MissingComponentException: There is no 'Animation' attached to the "background" game object, but a script is trying to access it.
You probably need to add a Animation to the game object "background". Or your script needs to check if the component is attached before using it.
However if I do no code the animation just plays trough all 16 frames. So i gues there is animation after all.
On the background GameObject I have 2 components first is sprite renderer and second is animator. When I open animator in Animator view i see there green rectangle saying Any state and yellow one with "field_back_anim". I don't get what i'm doing wrong.
I will also except any other solution that does the following.
Thanks!
The animator component is used to control transition between many animation clips. If you're going to playing an animation clip on a gameobject, an animation component is proper, not the animator. Remove the animator and add an animation component to your background gameobject in the inspector. If you set animation property to field_back_anim, your gameobject will animate well. Manipulation codes should be changed like below.
Animation ani = background.GetComponent<Animation>();
ani["field_back_anim"].time = 0.5f;
ani["field_back_anim"].speed = 0;

Adobe Edge - Growing Circle Animation

I'm making a product site in Adobe Edge. I have a circle div that needs to grow in a span of, let's say, 2 seconds when mouseover. Then a text has to appear in it. When mouseout, the text must disappear and do the reverse animation back to normal size. The circle has also to grow from its center, not the top left corner. I'v been trying to do this for hours with jquery and css3 animations but failed to get a satisfying result.
This is very easy with edge animate.
make your circle element.
set a key frame at 00:00 on the timeline for the circles width and height.
press Q (the transform tool) or select the icon at the top left of the screen just to the right of the arrow.
The transform tool scales things based on the origin point, which is repositionable but is automatically in the center of the selected object.
go to 02:00 on the timeline.
resize your circle.
set a keyframe for your text at 0 opacity.
go forward on the timeline.
set another keyframe for your text at 100% opacity.
group the circle and text into a div.
right click on that div and press 'convert to symbol'.
go back to the stage by clicking 'stage' on the top left of the preview window.
select the object that you want to use to trigger the animation.
open the actions for that object.
paste the following code into a mouseover event: var mySymbolObject = sym.getSymbol("INSERT THE NAME OF YOUR SYMBOL").play();
now make a mouseout event and paste this code: var mySymbolObject = sym.getSymbol("INSERT THE NAME OF YOUR SYMBOL").playReverse();
now what should happen is that onMouseOver, the timeline for that symbol plays forward, and onMouseOut, the timeline for that symbol plays in reverse. This way, if the animation is half way through and they mouse out, it will reverse from where it's at back to the beginning.
Probably you would like also to use mouseenter/mouseleave events rather than mouseover/mouseout, if you will nest text div inside circle div.
http://www.bennadel.com/blog/1805-jQuery-Events-MouseOver-MouseOut-vs-MouseEnter-MouseLeave.html

Resources