Play selected Movie Clip in same frame - overlap issue

  • dan007mnr
  • Newbie
  • Newbie
  • dan007mnr
  • Posts: 7
  • Loc: Wisconsin

Post 3+ Months Ago

First of all, thank you all for this incredible forum, I have NOT been able to find a solution anywhere, and so here it goes:
Basically, I have set up a flash for a client of mine where there is a primary and secondary selection issue. There are 2 areas that people will be able to view multiple fabric swatches - ultimately a large number - and I need to have them jump back and forth between them, leaving the previous swatch selected.
I have it set up when Primary button is selected to play primary movie containing the layers of fabric swatches, when each is selected. THIS WORKS FINE.
Same w/ secondary. However, I am having it jump to (frame 3) or (4) depending, which cancels out the previous selection...
It is like I need to have it jump to the same frame, containing BOTH Movie Clips, but then the swatches overlap...
Seems like if I can tell it "when one button is selected, then activate IT, or deactivate the other" but I do not know how, and have been struggling with it for some time. It is a small file, and I would be extremely grateful for anyone with a small amount of time to help me a bit. I would be more than happy to email the FLA files to you and or chat AIM about it... - dan007mnr -

Never used an IF/Then command, but !? Thank you all very much, look forward to helping others out as well.

-Dan
  • Tchuki
  • Mastermind
  • Mastermind
  • Tchuki
  • Posts: 1774
  • Loc: Edinburgh

Post 3+ Months Ago

Psuedo code:

if one button and another button are selected
deselect one of the buttons
play movie clip according to selected button


Example code:
PHP Code: [ Select ]
if (btn1.getState(true) && (btn2.getState(true))) {
 
  btn2.setState(false);
 
  gotoAndPlay("frame");
 
} else {
 
  // do something else
 
}
  1. if (btn1.getState(true) && (btn2.getState(true))) {
  2.  
  3.   btn2.setState(false);
  4.  
  5.   gotoAndPlay("frame");
  6.  
  7. } else {
  8.  
  9.   // do something else
  10.  
  11. }
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

well, i suggest first use some IF operations.
if (the hour == 17 o'clock) { drink tea }
else
if (the hour == 19 o'clock) { watch news }
else
if (the hour == 22 o'clock) { sleep }
see, it's so easy.
  • dan007mnr
  • Newbie
  • Newbie
  • dan007mnr
  • Posts: 7
  • Loc: Wisconsin

Post 3+ Months Ago

Thanks for your help here...

To comment first on Tchuki's post:
is there a way to specify a specific movie clip WITHIN a frame?!?!? That would be the ultimate way for me to get this solved. On top of that, I need to disable (seemingly) the other layer, or movie clip, since the selectable region (layer) sits above the other one....Problem is that each selectable areas overlap, and I can't (don't think) have them outside of the same frame, or it resets itself (movie clips start over, and don't stay on desired swatch).

To comment on IceCold's post:
Similar to the previous question I just made, can I specify a movie clip within the same frame? I am trying to keep it simple since I need to ultimatly output almost 1300 images to do 12 differnt FLA's. It seems like a command similar to this should work, but doesn't:
(PRIMARY ONE):
on (click) {
loadMovieNum("MOV-Primary-01.swf", 3);
}
  • dan007mnr
  • Newbie
  • Newbie
  • dan007mnr
  • Posts: 7
  • Loc: Wisconsin

Post 3+ Months Ago

(some got cut off) here is one of the other things that I thought should work, but doesn't. And if it DID, I am wondering about that overlap area...
on (click) {
//Movieclip GotoAndPlay Behavior
this._parent.Secondary.gotoAndPlay("3");
//End Behavior

}
  • Tchuki
  • Mastermind
  • Mastermind
  • Tchuki
  • Posts: 1774
  • Loc: Edinburgh

Post 3+ Months Ago

Yes you can specifiy any movieClip as long as you reference it correctly from the _root timeline.

Have a look into the unLoad function to remove the MC that you dont want.
  • dan007mnr
  • Newbie
  • Newbie
  • dan007mnr
  • Posts: 7
  • Loc: Wisconsin

Post 3+ Months Ago

I just thought of a good way to describe this... Basically, I want to DEACTIVATE the top Movie Clip when one radio (or other) button is selected so the bottom one that contains the same set of buttons, only a different region of the product (artwork) can be modified with the multiple swatches and colors. THEN when the upper layer button is selected, that one would become ACTIVE again, needs to be dynamic and back and forth, there are 54 various swatches, 2 editable sections of the artwork, equalling 108 ultimate changes available creating thousands of combinations... 2 important things here... I need to keep artwork for both visible at all times, even when one is diabled or deactivated from mouse functions AND the selections for either need to maintain whichever swatch was last selected by user. (ultimately leaving the ability to compare / mix thousands of color options.

?! Again, thank you so much. AIM: dan007mnr
  • Tchuki
  • Mastermind
  • Mastermind
  • Tchuki
  • Posts: 1774
  • Loc: Edinburgh

Post 3+ Months Ago

To be honest, I would only have one movie active at any one point, collect the user input in an array then pass that information out accordingly.
  • dan007mnr
  • Newbie
  • Newbie
  • dan007mnr
  • Posts: 7
  • Loc: Wisconsin

Post 3+ Months Ago

Oh man, I thought I knew SOMETHING the past couple years using Flash, but apparently I have no idea :s
Again, I am very thankful for this help, but have no clue to what an array is. I am sure it is frustrating for some of you to hear this, but !?!?

It might be simple, not sure - it sounds like what I need to do.

As to reiterate my last statement, if I can 'disable' or 'deactivate' (yet remain visible, and keep position) of either layer containing the two seperate MC's, that seems like it would work as well!? As long as their in the same frame #... Something like this perhaps?

button1.enabled=false;

I am going to give that a whirl right now... Thanks again.
  • Tchuki
  • Mastermind
  • Mastermind
  • Tchuki
  • Posts: 1774
  • Loc: Edinburgh

Post 3+ Months Ago

Why must you have both MC's visible if only one is being used by the user at any one point ?

As I said, using one MC, collect required info in an array:

Code: [ Select ]
array myArray[] = { var1, var2, var3 };


Then pass that info to your next MC once the first MC has completed its course of action.

Psuedo code

Choose between MC 1 or 2
If MC1 is choosen
Load MC1 into SWF
View MC
Collect variables
Store in an array
Once MC is complete pass array to MC2
Else if MC2 is choosen
Load MC2 into SWF
View MC
Collect variables
Store in an array
Once MC is complete pass array to MC1
  • dan007mnr
  • Newbie
  • Newbie
  • dan007mnr
  • Posts: 7
  • Loc: Wisconsin

Post 3+ Months Ago

Whew, thank to all for your help. hopefully I will get to your level someday, but a great friend was able to get it done within a couple hours, vs. my 16+ of stuggling... Basically here is the situation. Each selection button (primary / secondary) are MC's with appropriate names, then, remained the Primary MC and Secondary MC. The swatch area (being the same for both Primary and Secondary) is the last MC. The whole overall Flash is one frame. The top level Actionscript is:

Code: [ Select ]
stop();
//_global.section = "null";

primaryBtn_mc.onPress = function(){
    _global.section = "primary";
    primaryBtn_mc.gotoAndStop("On");
    secondaryBtn_mc.gotoAndStop("Off");
}
secondaryBtn_mc.onPress = function(){
    _global.section = "secondary";
    secondaryBtn_mc.gotoAndStop("On");
    primaryBtn_mc.gotoAndStop("Off");


----------

The script for the swatch area MC is: (Suede being one of the swatches I have been referencing-could be labeled whatever):

onEnterFrame = function(){
    //Suede 1
    if(_global.section == "primary"){
        suede1.onPress = function(){
            _root.primary_mc.gotoAndStop(2);
        }
        suede2.onPress = function(){
            _root.primary_mc.gotoAndStop(3);
        }
        suede3.onPress = function(){
            _root.primary_mc.gotoAndStop(4);
        }
    }
    else{
        suede1.onPress = function(){
            _root.secondary_mc.gotoAndStop(2);
        }
        suede2.onPress = function(){
            _root.secondary_mc.gotoAndStop(3);
        }
        suede3.onPress = function(){
            _root.secondary_mc.gotoAndStop(4);
        }
    }
}
  1. stop();
  2. //_global.section = "null";
  3. primaryBtn_mc.onPress = function(){
  4.     _global.section = "primary";
  5.     primaryBtn_mc.gotoAndStop("On");
  6.     secondaryBtn_mc.gotoAndStop("Off");
  7. }
  8. secondaryBtn_mc.onPress = function(){
  9.     _global.section = "secondary";
  10.     secondaryBtn_mc.gotoAndStop("On");
  11.     primaryBtn_mc.gotoAndStop("Off");
  12. ----------
  13. The script for the swatch area MC is: (Suede being one of the swatches I have been referencing-could be labeled whatever):
  14. onEnterFrame = function(){
  15.     //Suede 1
  16.     if(_global.section == "primary"){
  17.         suede1.onPress = function(){
  18.             _root.primary_mc.gotoAndStop(2);
  19.         }
  20.         suede2.onPress = function(){
  21.             _root.primary_mc.gotoAndStop(3);
  22.         }
  23.         suede3.onPress = function(){
  24.             _root.primary_mc.gotoAndStop(4);
  25.         }
  26.     }
  27.     else{
  28.         suede1.onPress = function(){
  29.             _root.secondary_mc.gotoAndStop(2);
  30.         }
  31.         suede2.onPress = function(){
  32.             _root.secondary_mc.gotoAndStop(3);
  33.         }
  34.         suede3.onPress = function(){
  35.             _root.secondary_mc.gotoAndStop(4);
  36.         }
  37.     }
  38. }

Really, pretty basic. Simple is not always too easy to obtain however, and I was stuck!
Thank you all for your input, very appreciated. hope to learn more about arrays down the road. Inspired from the comments.
Thanks so very much Kris for doing this, and dummying it up for me! Much appreciation to you all.

-Dan
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

pretty basic but not effective.
Why you use onEnterFrame if you don't really need it?
Wouldn't it be more easy to just move the code from onEnterFrame into primaryBtn_mc.onPress, respective the else part into secondaryBtn_mc.onPress.

Post Information

  • Total Posts in this topic: 12 posts
  • Users browsing this forum: No registered users and 8 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.