Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Just Realised



Hi
I see you can just select the lines in frame 4 and delete them.

Can you explain this:

In the .fla I am trying to learn from the author has this code

[as]
on(press) {
startDrag(this);
_root.answer1="";
}

on(release) {
stopDrag();
if (this._droptarget == "/bow") {
_root.answer1="Correct";
_root.allCorrect +=1;
}
else{
_root.answer1 = "wrong";
}
}
[/as}
Basically, an invisible button over the text "bow" is dragged onto the boat - if its dropped onto the bow of the boat dynamic text appears saying "Correct" and 1 is added to the allCorrect variable. There is more of this code allowing a similar action to be done with 4 other bits of the boat, when all 5 have been dropped onto the correct parts this code is triggered
code:
allCorrect =0;
// check if all answers
// are correct
_root.onEnterFrame= function(){
if(_root.allCorrect==5){
_root.endComment = "All Correct";
}
}

The code above is in an action layer, frame 1 of the main movie. I think the onEnterFrame must be getting called continuously in a loop because the flash movie is only 1 frame long so Flash will continually loop through Frame 1 - is that correct? Also, I'm not too sure why the line allCorrect = 0 only gets done once, I guess on the initial visit to this frame, it must only execute once or the "allCorrect" variable will never get to 5 - any thoughts on how to help me understand this code?



FlashKit > Flash Help > Flash General Help
Posted on: 02-13-2005, 11:59 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Went Over 16000 Only Just Realised, Need To Call External Swf And Control
Basically i have made an 18000 frame flash application and need to call on a second swf i have made to split it up.

I am not really sure how to do this, i have put an empty movie clip in a scene in the main movie.

I would like the external swf preloaded into this movie clip and it also has two different frame labels which i would like called upon from buttons in the main movie.

What i would like to know is how i could preload the external swf into the movie clip in the scene in the main movie, using my current preloader for the main movie:


stop();
var bt = _root.getBytesTotal();
kbt.text = Math.round(bt/1000);
_root.onEnterFrame = function () {
var bl = _root.getBytesLoaded();
var pr = bl/bt*100;
kbl.text = Math.round(bl/1000);
prl.text = Math.floor(pr)+"%";
bar_mc._xscale = pr;
if (pr == 100) {
delete this.onEnterFrame;
gotoAndPlay("Intro", 1);
}
}
gotoAndPlay(1)

and I would also like to know how to call this loaded clip in a scene from a button in another scene.

I hope this isn't too confusing, i have looked all over the forum but i just find part answers that don't really help me.

Cheers

CZ

Copyright © 2005-08 www.BigResource.com, All rights reserved