Salutations to all Kirupians and Visitors!
I am in need of some assistance. I have searched the forum and tutorials, and did not find the solution for the problem I have. Hopefully I am in the correct forum! <- my ability to identify the type of problem I am having is apart of why I haven’t solved the problem, and therefore, I don’t think I have enough knowledge to have concrete beliefs whether or not this posting belongs in Actionscript or MX. Any opinions?
I am learning how using flash is like using legos. if you have two eight hole pieces, and you put them together using only two holes, the lego structure will not be as strong or work so well. seems like you have to cover the entire basis (put all eight holes into the eight pegs) for the program to work, and I am reading the help section for this, although if anyone knows of some good books that hold valuable knowledge and wisdom, I would certainly like to know about them, as I am dedicated to learning flash.
I have 1.swf, that in order to get it to operate as I have programed it, I must play it in the flash player. Playing it in Flash Professional does not work in its entirety because of conflicts in the enter key’s duties. The 1.swf works as it should when played in the flash player outside of Flash Professional MX 2004.
Herein lies the problem. When I am loading 1.swf into presentation style 2.swf, and then play 2.swf in the Flash Player, the key board functionality of 1.swf [COLOR=Green](most specifically the enter key) [/COLOR]does not operate as the 1.swf Actionscript 2.0 defines. I have created a projection file as well, to see if there was any other behavior that might occur, but the result were the same. Has anyone experienced this before and/or know how to fix this issue?
I truly appreciate any help that can be given.
Here is the section of the code dealing with the keys:
I have tried separating the different if(Key.isDown(Virtual Key Code) statements into different keyboard listeners, but to no avail.
If in order to solve this issue - if the kind Kirupian reading this stuff needs more code, let me know, as I’ll have the rest of the comments finished shortly.
I am beginning to wonder whether an .swf file has a hierarchy for keyboard listeners between .swf files being loaded and the ones doing the loading?
Could there be some standard structure that my code has some type of interference with and that is the cause for the malfunctioning .swf?
[COLOR=DimGray]//1.swf is loaded into a empty MC from within 2.swf.[/COLOR]
[COLOR=RoyalBlue]this[COLOR=Black].[COLOR=RoyalBlue]createEmptyMovieClip[COLOR=black]([/COLOR][COLOR=Red]“a_mc”[/COLOR][COLOR=black], 0);[/COLOR]
loadMovie[COLOR=Black] ([COLOR=Red]"[/COLOR][/COLOR][COLOR=Black][COLOR=Red]relative_file_name_1.swf"[/COLOR], a_mc);[/COLOR]
[/COLOR][/COLOR][/COLOR]
[COLOR=RoyalBlue] var[/COLOR] re:[COLOR=RoyalBlue]Object[/COLOR] = [COLOR=RoyalBlue]new Object/COLOR;
[COLOR=Gray] //Keyboard listener[/COLOR]
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//----------------------------------------------
re.[COLOR=RoyalBlue]onKeyDown[/COLOR] = function() { [COLOR=Gray]// sets the key object’s duties [/COLOR][INDENT][COLOR=RoyalBlue] if[/COLOR] ([COLOR=RoyalBlue]Key[/COLOR].[COLOR=RoyalBlue]isDown/COLOR) { [COLOR=Gray]// determines if the key pressed is the wanted key[/COLOR]
[/INDENT][INDENT][INDENT][COLOR=Gray] //the comma key[/COLOR]
[/INDENT][/INDENT][INDENT][INDENT][COLOR=RoyalBlue] stop/COLOR;
[/INDENT][/INDENT][INDENT][INDENT] //[COLOR=Gray] stops and sends the playhead back one frame[/COLOR]
[/INDENT][/INDENT][INDENT][INDENT][COLOR=RoyalBlue] gotoAndStop/COLOR;
[/INDENT][/INDENT][INDENT][INDENT] }
[/INDENT][/INDENT][INDENT][COLOR=RoyalBlue] if[/COLOR] ([COLOR=RoyalBlue]Key[/COLOR].[COLOR=RoyalBlue]isDown/COLOR) { [COLOR=Gray]// makes sure that the needed key is the one pressed[/COLOR]
[/INDENT][INDENT][INDENT][INDENT][COLOR=Gray] //the period key[/COLOR]
[/INDENT][/INDENT][/INDENT][INDENT][INDENT][COLOR=RoyalBlue] stop/COLOR;
[/INDENT][/INDENT][INDENT][INDENT][COLOR=Gray] // stops and sends the playhead forward one frame[/COLOR]
[/INDENT][/INDENT][INDENT][INDENT][COLOR=RoyalBlue] gotoAndStop/COLOR;
[/INDENT][/INDENT][INDENT] }
[/INDENT][INDENT] if ([COLOR=RoyalBlue]Key[/COLOR].[COLOR=RoyalBlue]isDown/COLOR) {
[/INDENT][INDENT][INDENT][COLOR=Gray] //the enter key[/COLOR]
[/INDENT][/INDENT][INDENT][INDENT][COLOR=RoyalBlue] if [/COLOR](z == _level0.gtFrame) {
[/INDENT][/INDENT][INDENT][INDENT][INDENT][COLOR=Gray] //if the focus is on the go to frame text box(gtFrame)[/COLOR]
[/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][COLOR=RoyalBlue] var[/COLOR] c:[COLOR=RoyalBlue]String[/COLOR] = [COLOR=RoyalBlue]new String/COLOR;[COLOR=Gray] //takes the //input from the text box and turns it into a string[/COLOR]
[/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][COLOR=RoyalBlue] var[/COLOR] d:[COLOR=RoyalBlue]Number[/COLOR] = [COLOR=RoyalBlue]parseInt/COLOR; [COLOR=Gray]// turns the string into a //Number[/COLOR]
[/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT] oo.cla(d); [COLOR=Gray]//Frame.as object basically performs //gotoAndStop(var a:Number)[/COLOR]
[/INDENT][/INDENT][/INDENT][INDENT][INDENT] } [COLOR=RoyalBlue]else if[/COLOR] (z == _level0.check) {
[/INDENT][/INDENT][INDENT][INDENT][INDENT][COLOR=Gray] //if the focus is on the check box[/COLOR]
[/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT] check.[COLOR=RoyalBlue]selected[/COLOR] = !check.[COLOR=RoyalBlue]selected[/COLOR];
[/INDENT][/INDENT][/INDENT][INDENT][INDENT] }[COLOR=RoyalBlue] else if[/COLOR] ((z == _level0.strt_loop_txt) || (z == _level0.end_loop_txt) || (z == _level0.rb1) || (z == _level0.rb2) || (z == _level0.rb3) || (z == _level0.ps_txt)) {
[/INDENT][/INDENT][INDENT][INDENT][INDENT][COLOR=Gray] //if the focus is set on any of the custom loop’s radio //components or text boxes[/COLOR]
[/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][COLOR=RoyalBlue] if /COLOR {
[/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT] //if moving from a play reverse to a play loop action
[/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT] thread = [COLOR=RoyalBlue]false[/COLOR];
[/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][COLOR=RoyalBlue] clearInterval/COLOR;
[/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT] }
[/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][COLOR=RoyalBlue] i[/COLOR][COLOR=RoyalBlue]f[/COLOR] (threadtwo) {
[/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][COLOR=Gray] //if moving from a play reverse loop to play loop[/COLOR]
[/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT] threadtwo = [COLOR=RoyalBlue]false[/COLOR];
[/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][COLOR=RoyalBlue] delete onEnterFrame[/COLOR];
[/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][COLOR=RoyalBlue] clearInterval/COLOR;[COLOR=Gray]
[/COLOR][INDENT][COLOR=Gray]// this is needed to end the processes in case there is a change from play reverse loop to play[/COLOR]
[/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT] }
[/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][COLOR=RoyalBlue] if /COLOR {
[/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][COLOR=Gray] //if a pause interval has been set - aaa is set true when a pause interval has been called[/COLOR]
[/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT] aaa = [COLOR=RoyalBlue]false[/COLOR];
[/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][COLOR=RoyalBlue] clearInterval/COLOR; [COLOR=Gray]// eee is the interval that runs a pause effect[/COLOR]
[/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT] }
[/INDENT][/INDENT][/INDENT][COLOR=Gray] //This series of code is similar to the play_btn code if (check.selected == true)
//sets up the var for the loop and calles the needed methods to make the loop function[/COLOR][INDENT][INDENT][INDENT][COLOR=RoyalBlue] var [/COLOR]iiiii:[COLOR=RoyalBlue]String [/COLOR]= [COLOR=RoyalBlue]new String/COLOR;
[/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][COLOR=Gray] //take the text from the start loop input //text field, signifying the first frame in the //loop[/COLOR]
[/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][COLOR=RoyalBlue] var [/COLOR]jjjjj:[COLOR=RoyalBlue]Number[/COLOR] = [COLOR=RoyalBlue]parseInt/COLOR;
[/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][COLOR=Gray] // turn that string into a number so the // computer can utilize the value
[/COLOR][/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][COLOR=RoyalBlue] var[/COLOR] kkkkk:[COLOR=RoyalBlue]String[/COLOR] = [COLOR=RoyalBlue]new String/COLOR;
[/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][COLOR=Gray] //take the text from the total # of frames //in the loop text field[/COLOR]
[/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][COLOR=RoyalBlue] var[/COLOR] lllll:Number = [COLOR=RoyalBlue]parseInt/COLOR;
[/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][COLOR=Gray] // turn the Total #Of Frames In The string // into a Number[/COLOR]
[/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][COLOR=RoyalBlue] var[/COLOR] nnnnn:[COLOR=RoyalBlue]Number[/COLOR] = lllll+jjjjj;
[/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][COLOR=Gray] // this line is necessary to determine which // frame is the end of the loop[/COLOR]
[/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT] oo.cla(jjjjj);[COLOR=Gray]
[/COLOR][INDENT][COLOR=Gray]//Frame.as object basically performs //gotoAndStop(var a:Number)
// takes the playhead to the beginning of // the loop[/COLOR]
[/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][COLOR=RoyalBlue] play/COLOR;
[/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][COLOR=Gray] // set the loop/playhead into motion[/COLOR]
[/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][COLOR=RoyalBlue] onEnterFrame[/COLOR] = [COLOR=RoyalBlue]function[/COLOR] () {
[/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][COLOR=RoyalBlue] if[/COLOR] ([COLOR=RoyalBlue]_currentframe[/COLOR] == nnnnn) {
[/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][INDENT][COLOR=Gray] // evaluates when the loop //has reached the userdefined //end of loop[/COLOR]
[/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][INDENT]oo.cla(jjjjj);
[/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][COLOR=Gray] // becuase this is not a play reverse loop, we can // send the playhead back to the beginning of the loop // when the end of loop is reached.[/COLOR]
[/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][INDENT][COLOR=RoyalBlue]if[/COLOR] (rb1.[COLOR=RoyalBlue]selected[/COLOR]) {
[/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][INDENT][INDENT][COLOR=Gray] // this is continuous loop, no pause[/COLOR]
[/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][INDENT][INDENT][COLOR=Gray][COLOR=RoyalBlue] play[/COLOR]COLOR=Black;[/COLOR][/COLOR]
[/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][INDENT] } [COLOR=RoyalBlue]else[/COLOR] {
[/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][INDENT][INDENT][COLOR=RoyalBlue] stop/COLOR; [COLOR=Gray]
//if this is any // other type of // loop, it will stop // between // iterations[/COLOR]
[/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][INDENT] }
[/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT] }
[/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][COLOR=RoyalBlue] if[/COLOR] (rb2.[COLOR=RoyalBlue]selected[/COLOR]) {
[/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][INDENT][COLOR=Gray] // if the ‘pause’ radio button is // selecte[/COLOR]d
[/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][INDENT] txt:[COLOR=RoyalBlue]String[/COLOR] = [COLOR=RoyalBlue]new String/COLOR;
[/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][INDENT][COLOR=Gray] // take the variable form the // input text field[/COLOR]
[/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][INDENT] rr:[COLOR=RoyalBlue]Number[/COLOR] = [COLOR=RoyalBlue]parseFloat/COLOR;
[/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][COLOR=Gray] // must keep the decimal from a greater degree of accuracy, hence float[/COLOR]
[/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][INDENT][COLOR=RoyalBlue] if [/COLOR]([COLOR=RoyalBlue]isNaN/COLOR || rr<0) {
[/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][COLOR=Gray] // just in case there is nothing in the field or a negative number[/COLOR]
[/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][INDENT][INDENT] rr = 1;
[/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][COLOR=Gray] // it will be set equal to one second[/COLOR]
[/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][INDENT] }
[/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][INDENT] qq = [COLOR=RoyalBlue]_global[/COLOR].sp(rr);
[/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][COLOR=Gray] // method call to return the # of iterations a loop must // run to simulate the pause in seconds[/COLOR]
[/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT] cc = [COLOR=RoyalBlue]setInterval(_global.[/COLOR]ps(qq), 17);
[/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][COLOR=Gray] // sets the interval for calling the pause method[/COLOR]
[/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][INDENT] aaa = true;
[/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][COLOR=Gray] // when this variable is true, it activates code that will shut down the cc Interval[/COLOR]
[/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT] }
[/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][COLOR=RoyalBlue] if[/COLOR] (rb1.[COLOR=RoyalBlue]selected[/COLOR] || rb3.[COLOR=RoyalBlue]selected[/COLOR]) {
[/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][INDENT][COLOR=RoyalBlue] if[/COLOR] (aaa) {
[/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT] [COLOR=Gray]// using aaa in this way will reduce the # // of times this clear interval is called to // only those times when the setInterval // has been called[/COLOR]
[/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][INDENT][INDENT] aaa = [COLOR=RoyalBlue]false[/COLOR];
[/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][INDENT][INDENT] clearInterval(cc);
[/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT][INDENT] }
[/INDENT][/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT][INDENT] }
[/INDENT][/INDENT][/INDENT][/INDENT][INDENT][INDENT][INDENT] };
[/INDENT][/INDENT][/INDENT][INDENT][INDENT]}
[/INDENT][/INDENT][INDENT] }
[/INDENT]};
[COLOR=RoyalBlue] Key[/COLOR].[COLOR=RoyalBlue]addListener/COLOR;
Maybe I could send you an email with the file .fla minus the embedded video(otherwise the file size is 13mb, which I can only send 10mb right now).
thank you for your time!!