This content has been marked as final.
Show 14 replies
-
1. Re: Possible to skip frames?
kglad Jul 9, 2007 6:48 AM (in response to Magiciandude)use an if-statement within the coding for your left and right arrow blocks to decide whether a module should be "skipped" or "not skipped". -
2. Re: Possible to skip frames?
Magiciandude Jul 9, 2007 6:51 AM (in response to Magiciandude)Hey!
Thanks for your reply!
But I then still have the problem of how to skip it? If I just use the "_root.modules.nextFrame()" code...then it plays through them until it gets to one that's true...and I can't use a gotoAndStop code because I can't define a specific frame...so I think my question in reality is how do I actually skip the frames?
Thanks again for your reply though!
-Chris -
3. Re: Possible to skip frames?
kglad Jul 9, 2007 6:58 AM (in response to Magiciandude)that depends on your modules set-up and how you programmed your arrow buttons. you may need to create an array of frame labels to determine the correct frame to play if your modules movieclip isn't conveniently set-up for this. -
4. Re: Possible to skip frames?
Magiciandude Jul 9, 2007 7:07 AM (in response to Magiciandude)Hmmm...
Well its set up as follows(Ill try to explain it the best I can):
The modules are in a separate SWF with a bunch of frames with modules on them and a stop(); script on the first frame.
The arrows are set up with code that says:
on(release){
_root.modules.nextFrame();
}
or
on(release){
_root.modules.prevFrame();
}
So its nothing really complex...
But the frames don't have labels in the movie clip...but the modules in the swf do. They are labeled module+the number of the frame(frame 12 for instance is module12).
So...thats how its set up...if that helps at all!
Thanks again for your reply!
-Chris -
5. Re: Possible to skip frames?
kglad Jul 9, 2007 7:15 AM (in response to Magiciandude)that looks conveniently set-up: so, each module 1,2,... is on frame 1,2,... of the module's movieclip and there's a variable corresponding to each module that's true or false? -
6. Possible to skip frames?
Magiciandude Jul 9, 2007 7:20 AM (in response to Magiciandude)Yes...except its not really a variable...its an attribute in an external XML file. I then imported that attribute...and on another movie clip I put the code:
onClipEvent(enterFrame){
_root.propertyone = _root.plcdata_xml.firstChild.firstChild.firstChild.childNodes[_root.modules._currentframe ].attributes.PROPERTYONE;
}
So this way it makes a dynamic text box either say true or false according the XML and the current frame of the the "modules" movie clip. And then I can use the dynamic text box as a variable...So I guess thats pretty much exactly what you just said!
Hopefully that cleared things up a bit!
-Chris -
7. Re: Possible to skip frames?
kglad Jul 9, 2007 7:37 AM (in response to Magiciandude)having an onEnterFrameHandler is unnecessarily inefficient. but be that as it may, you can use:
-
8. Re: Possible to skip frames?
Magiciandude Jul 9, 2007 7:49 AM (in response to kglad)First of all thanks for the code!
I just can't quite get this to work though...
I would need to paste this on the button...right?
Also, you said that the onEnterFrameHandler is inefficient. Does this mean that there is a more efficient way to do this?
Thanks!
-Chris -
9. Re: Possible to skip frames?
kglad Jul 9, 2007 10:29 AM (in response to Magiciandude)that code would replace your current on(release) code for your next button.
and yes, there's no reason to repeatedly check modules._currentframe. just update your _root.propertyone variable with modules._currentframe changes. or if that changes from many locations, use the watch() function. -
10. Possible to skip frames?
Magiciandude Jul 9, 2007 10:42 AM (in response to kglad)Oh no! It still doesn't work!
Okay...well...the button doesn't have a parent...so I went ahead and got rid of _parent...so now it lets you scroll through the modules.
It just doesn't skip to the ones with the attribute set to "true"
However I think I might know what the problem is...just not how to fix it...
In the XML its not literally set to true...the xml is typed like this for example:
<F0-08NA-1 PNUMBER = "F0-08NA-1" MODULENAME="F0-08NA-1" DESCRIPTION="8PT 110VAC AC INPUT" PRICE="47.00" DISCRETEINPUTS="8" DISCRETEOUPUTS="0" ANALOGINPUTS="0" ANALOGOUPUTS="0" FIVEVOLTPOWERBUDGET="-5" PROPERTYONE="true" />
True is just an attribute...which probably threw you off because of my failure to explain things right...
Would you know how to fix this?
Thanks again for your help!
-Chris -
11. Re: Possible to skip frames?
Magiciandude Jul 9, 2007 10:48 AM (in response to Magiciandude)Okay...got it...
I changed the if(propertyOne) in the end to if(propertyOne=="true")
Now remains the problem of not skipping frames though. It still plays all of them...it just stops on the ones with the property...
-Chris -
12. Re: Possible to skip frames?
kglad Jul 9, 2007 11:20 AM (in response to Magiciandude)replace your on(release) with:
-
13. Re: Possible to skip frames?
Magiciandude Jul 9, 2007 11:27 AM (in response to Magiciandude)YES!!! It works!!!
Thank you VERY VERY VERY much for your help!!!
I don't know what I would've done without you!
-Chris -
14. Re: Possible to skip frames?
kglad Jul 9, 2007 11:55 AM (in response to Magiciandude)you're welcome.