This content has been marked as final. Show 14 replies
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".
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!
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.
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:
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!
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?
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:
_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!
having an onEnterFrameHandler is unnecessarily inefficient. but be that as it may, you can use:
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?
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.
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!
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...
replace your on(release) with:
YES!!! It works!!!
Thank you VERY VERY VERY much for your help!!!
I don't know what I would've done without you!