Copy link to clipboard
Copied
Hi to all!
I work on some projects with lot of frames for android app. I have navigation layer with buttons. In some cases i have button working only on firts keyframe and not on rest of frames after it, ragarding of the fact its visible offcourse. I work on whoče project and have another buttons wihch work, but i really dont have idea how did i make it work. But only home button, one which goes through whole layer uninterupted is allways clickable and working no matter what
using a file server, upload your fla with a home button in a layer with one keyframe where the home button stops working and post a link here.
indicate which is the home button and the layer it's in and the frame where it first fails.
Copy link to clipboard
Copied
if an object (button, movieclip or graphic) is not in the same keyframe where it was instantiated, there are several ways to cause it to fail to respond to code.
Copy link to clipboard
Copied
Well, button is on the another layer, which goes throigh lets say 20 frames. So on whichever frame i go, that button is there with its gotoframe and stop action coupled. Home button worka awesome througjput all project. As soon as i pit another button on that layer, frame turns on keyframe on that layer, and that another button wprks but only on that frame not on the rest of frames that layer covers, even if its visible
Copy link to clipboard
Copied
don't put another object on that layer.
Copy link to clipboard
Copied
But i made it work on first 500 frames, with 4 keyframes between, i did something i wasnt awere off, and before also wasnt working, but i was able to make it work somehow. and now again sam thing...hm
Copy link to clipboard
Copied
oh, if you're careful you can have many keyframes after the first. otherwise, it's easy to cause problems exactly as stated in my first message.
Copy link to clipboard
Copied
I did put another layer, make keyframe on lets say 500 frame, then put button on it and that layer strech u til 600 frame. So it covers 100 frames, but works only on 1st framež i dont get it. bu on layer umder, it works normaly
Copy link to clipboard
Copied
So, whatever i do, id ont get to pass that exact frame. It just work on this frame not on the other. For example, i mae another layer, stretch it through whole project frames. Then, i make keyframe tu put first and only button on that layer to be visible from that frame to the end. And nothing, im stuck on that keyframe. And for the home button, this one i made first, it works normally, i did put it on beginnnig and it stretches thropugh 500 frames with no problems, and 3 keyframes between, starts from 100 frame
Copy link to clipboard
Copied
the only certain way to do this is to add your object on stage in its first keyframe, assign an instance name and then add your other keyframes without adding or removing anything.
Copy link to clipboard
Copied
But i cant do that, its so frustrating becaus emy lack of knowledge. I tried trilion times with different layers, with new buttons etx.
Hers the case. My first buttons start at 100 frame. Home button with arrows. Then on 200 frame, i delete arrows, just home. Imidiatelly keyframe is made uppon changing. Then on frame 400 i add another button to that home one. And then on 550 i need to delete that one, and add another 2. In all cases, home button works, but others only work until that last 570 frame. That is the frame i need to put other 2 buttons so they can cover additionaly 50 frames. But it only works on that keyframe that was made
Copy link to clipboard
Copied
you're doing exactly what i stated not to do. ie, that's an easy way to cause the problem you're seeing. it's also unnecessary, though you appear to think it is.
anyway if you insist on doing it your way, whenever an object is removed and then readded, assign it a different instance name and assign code for that "new" object.
Copy link to clipboard
Copied
I allways put another instance.
Ok...first i was doing all on one layer, each time afding button, giving it a unique instance, every time different, then after a while, codes were only worth on that keyframe ,not on another covering frame ok. Then i tryed with mučtiple layers, same thing. I cant put like you say obkect on first layer, because i must first past 100 layers without navigation visible Then it must appear, and then i have to add buttons every lets say 200 frames
Copy link to clipboard
Copied
Ok so, i didnt understand solution for this. If u can pls explain me. I want this. I have project...lets say 1000 frames. I have home button, which would be visible throughout whole project. And every 100 frames lets say, 200, i need another button beside that home button, different button each time. I did it on the same layer, and in some pont home button action atops to work. It work until 4th instamce, then stops. Every time i add some button near that home, keyframe is made, and i give that button another instance name and new action order. So that works until 4th instance of the same button. Then i realised , ok, i cant do it like that, so i finished that frame on the place where no longer worked, i made a new layer which starts frame after it worked, and i put new button, new instance etc, and i get same issue...like i didnt do anything, so anoying
Copy link to clipboard
Copied
Is there any difference if i once set that as button, another time as movie clip etc
Copy link to clipboard
Copied
yes, there's a difference.
look, you need to learn how to test things so you can debug your own creations. for example, your last question about changing an object type, i didn't know the answer. i would never do that and i've never done that and i don't recall anyone asking.
but i created an as3 file, added a button (b) on frame one, assigned an instance name and added this code to frame 1:
b.scaleX = .3;
then i added a keyframe to frame 10, in the properties panel changed instance behavior from button to movieclip (and noted the instance name remained unchanged), and tested. the object in frame 10 is not scaled. ie, it's not the same instance b that was on frame 1.
and there's a warning message: Scene 1, Layer 'Layer_1', Frame 1 Warning: The instance name 'b' is declared on an object of type flash.display.SimpleButton but there is a conflicting use of the instance name 'b' on an object of type flash.display.MovieClip.
further, if i try to reference that "new" instance b, i see this error message: TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Untitled_3_fla::MainTimeline/frame15()
Copy link to clipboard
Copied
now, the sure-fire way (again) to prevent all instance name problems:
1. create your instance on the first keyframe where you want it to appear and assign its instance name.
2. add other keyframes (where you want to make changes to the instance) in the layer that contains only that instance. (if that layer contains other instances and you make changes to those other instances, you might mess up those other instances.)
3. make any changes you want in any of those keyframes, EXCEPT, do not remove the instance. even if you remove it for a moment and quickly replace, you probably caused a problem.
the essential point that animate does not tolerate is adding and removing and readding instances and thinking you have the same instance because it looks the same and has the same instance name. (and you found a new, to me, way to mess up: change the instance behavior.)
Copy link to clipboard
Copied
So obviously you didnt understand me, were not talking about 2-3 buttons, were tlaking about one steady button and dozens changing arround it as frames passes. etc. never mind. i did exactly as you said, and in some point home stops to execute frame i assign it. I have 4 home buttons all on same layer with different instaces offcourse, because Animate give instances automatic.
Copy link to clipboard
Copied
using a file server, upload your fla with a home button in a layer with one keyframe where the home button stops working and post a link here.
indicate which is the home button and the layer it's in and the frame where it first fails.
Copy link to clipboard
Copied
I did another approach. I use scenes. So i have one scene for one navtab. etc
Thanks for your help
Copy link to clipboard
Copied
you're welcome.
(but for others, avoid scenes. they never add anything that can't be done with keyframes and can add extra complications.)
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more