Copy link to clipboard
Copied
Hello, question. I made 3 keyframes and got a looping nest in each frame. Now I would like to start with frame 1 looping untill you click an object and go to frame 2 which wil start looping and continue till I click another object again to go back to frame 1 (or frame 3).
My question is, do I make the clickable object in the scene mode or do I go one stage deeper and use actioncode in there? And what would be the correct code(s)? Hope this is clear enough, otherwise let me know and I trie and specifie.
Thanks, greets, Noob Frank
Copy link to clipboard
Copied
you should place your clickable object and code on the timeline that you want to control with stops and goto's.
Copy link to clipboard
Copied
Hello kglad, thank you for your replie. Unfortunately I cant seem to get the right result. Should be simple but I'm guessing something is not going right. I put the file as an attachment and only thing I would like happen, is start with frame 1 looping, then click the sirene to go to frame 2 and keep looping frame 2 and if you click the walkietalkie, yo go to frame 3. Should be fairly easy, but I can not make it happen. Frustrating! A little help would be awesome! Thanks in advance everybody!
Copy link to clipboard
Copied
you didn't and can't attach a fla. upload to dropbox or its equivalent.
Copy link to clipboard
Copied
Can I send you via email or otherwise?
Copy link to clipboard
Copied
yes. private message sent.
Copy link to clipboard
Copied
i received your fla.
what's the siren? Car.porto?
Copy link to clipboard
Copied
the blue thing on the right side front. Is that what you mean?
Copy link to clipboard
Copied
porto is the walkie talkie (in Dutch :))
Copy link to clipboard
Copied
your project is not set up to encode objects that are children of Car. (and having an object name Car on the Car timeline is not recommended - give one of them another name).
you need to create an object (which can be descendents of other objects) for anything that you want to reference in code.
that's usually a simple matter of right clicking the object > click convert to symbol > and select an object type (eg, moveiclip or graphic in the case of your siren).
in your situation, because a lot of those objects are tweened, you'll need to copy the frames in the layer and past those frames into the movieclip or graphic, replace the layer frame with a keyframe containing your newly created object and assign an instance name that you can then use in code.
Copy link to clipboard
Copied
Oke, so thinking I was almost there was a little mistake... Thank you for your time and I am going to look into it. Thanks!
Copy link to clipboard
Copied
you're welcome.
Copy link to clipboard
Copied
Just one more question to be clear, It's not possible to create a new layer in my scene, place a new object and make that function as Click and Go to frame 2 and repeat that frame 2?
Copy link to clipboard
Copied
yes, it is. that's a good work-around.
you can create an almost transparent object (alpha =1) and place that over your siren and give it an instance name (eg, siren_button). also, give the main timeline Car layer object and instance name (eg, car) and you can then use
this.car.siren_button.addEventListener("click", sirenF.bind(this));
function sirenF(e){
this.gotoAndStop(1); // go to your 2nd frame.
}
Copy link to clipboard
Copied
I tried as you suggested, but now I got it Flickering fast between the 3 frames. I sent you the fla again. If you do not have the time to look into I completely understand, but if you do have time then much appreciated 🙂
Copy link to clipboard
Copied
in your first frame you have
stop();
that should be:
this.stop();
does that solve your problem?
Copy link to clipboard
Copied
I does not
Copy link to clipboard
Copied
ok, i'll check the updated fla
Copy link to clipboard
Copied
Thank you again! Tommorow is judgement day, so trying to find all the help I can get 😉
Copy link to clipboard
Copied
carinside has an empty frame after its first frame. remove that.
Copy link to clipboard
Copied
p.s. you might want to enlarge your frames so it's easier to see what your timelines look like. eg, it's difficult to see your main timeline has 3 frames:
it's easier to see with a little frame enlargement
when you have hundreds or thousands for frames, it can be beneficial to shrink them, but that doesn't apply to your fla.
Copy link to clipboard
Copied
Good tip! Removed the empty frame, But unfortunately still flickering.
Copy link to clipboard
Copied
https://www.kglad.com/Files/forums/RECOVER_POLICECHASEmetActions_v000.fla
i changed your first goto to the 3rd frame because there's something different there.
Copy link to clipboard
Copied
I can see what you did, but when I export it it keeps flickering.
Copy link to clipboard
Copied
save to a new folder with a new publish name.