Re: [Flashcoders] reposition MC on release

2006-06-07 Thread jcanistrum

exactly as I told before

try to use vars to reference to object as much as possible and use this o
point to the current clip, if is _root fine, but if you move to another one
it still works

var myButton = this.attachMovie( "buttonMCinLibrary", "newName",
this.getNextHighestDepth()) ;

myButton.onRelease = function()
{
  this.endX = -500;
  this.endY = -200;
}





2006/6/7, Steven Sacks <[EMAIL PROTECTED]>:


Don't use on (release) {}, use btn.onRelease = function() {} in the frame.

Putting on (action) {} methods on button and movieclip instances is for
designers who don't know how to code.

When you assign button actions to movieclips or buttons, unless you use
"this", it's going to refer to the movieclip it resides in.

Example:

// Tells BTN_Foo's timeline to go to frame 2
BTN_Foo.onRelease = function() {
   this.gotoAndStop(2);
};

// Tells the timeline of the clip containing BTN_Foo to go to frame 2
BTN_Foo.onRelease = function() {
   gotoAndStop(2);
};
// Or you can write it like this
BTN_Foo.onRelease = function() {
   this._parent.gotoAndStop(2);
};

Same thing goes for variables.

You can assign the clip to the button.

BTN_Foo.clipToControl = _level0.MC_Clip;
BTN_Foo.onRelease = function() {
   this.clipToControl._x = 100;
};

HTH,
Steven

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com





--
João Carlos
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] reposition MC on release

2006-06-07 Thread Steven Sacks
Don't use on (release) {}, use btn.onRelease = function() {} in the frame.

Putting on (action) {} methods on button and movieclip instances is for
designers who don't know how to code.

When you assign button actions to movieclips or buttons, unless you use
"this", it's going to refer to the movieclip it resides in.

Example:

// Tells BTN_Foo's timeline to go to frame 2
BTN_Foo.onRelease = function() {
this.gotoAndStop(2);
};

// Tells the timeline of the clip containing BTN_Foo to go to frame 2
BTN_Foo.onRelease = function() {
gotoAndStop(2);
};
// Or you can write it like this
BTN_Foo.onRelease = function() {
this._parent.gotoAndStop(2);
};

Same thing goes for variables. 

You can assign the clip to the button.

BTN_Foo.clipToControl = _level0.MC_Clip;
BTN_Foo.onRelease = function() {
this.clipToControl._x = 100;
};

HTH,
Steven

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] reposition MC on release

2006-06-07 Thread mike cann

i think he means sumthin like this:

inside your button:

on (release)
{
 _root.myMC.endX = -500;
 _root.myMC.endY = -200;
}

assuming myMC is the movieclip you are talking about

On 07/06/06, jcanistrum <[EMAIL PROTECTED]> wrote:


if I understand it correctly, one way would be to use attachMovie like

var myMC = this.attachMovie( "MC", "newName", this.getNextHighestDepth())
;

myMC.onRelease = function()
{
   this.endX = -500;
   this.endY = -200;
}


2006/6/7, Tony Watkins <[EMAIL PROTECTED]>:
>
> OK, not sure I can explain this. The following code is inside the MC to
be
> repositioned. Notice the AS targets the button named contact.
>
>_root.contact.onRelease = function() {
>endX = -500;
>endY = -200;
>};
> }
>
> Fine. But what if I want to move the AS out of the actual MC and onto
the
> button named contact? How would I target the MC to be repositioned after
> on
> (release)?
>
>
> on (release) {
>something here I presume?
>endX = -500;
>endY = -200;
> }
> ___
> Flashcoders@chattyfig.figleaf.com
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>



--
João Carlos
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] reposition MC on release

2006-06-07 Thread jcanistrum

if I understand it correctly, one way would be to use attachMovie like

var myMC = this.attachMovie( "MC", "newName", this.getNextHighestDepth()) ;

myMC.onRelease = function()
{
  this.endX = -500;
  this.endY = -200;
}


2006/6/7, Tony Watkins <[EMAIL PROTECTED]>:


OK, not sure I can explain this. The following code is inside the MC to be
repositioned. Notice the AS targets the button named contact.

   _root.contact.onRelease = function() {
   endX = -500;
   endY = -200;
   };
}

Fine. But what if I want to move the AS out of the actual MC and onto the
button named contact? How would I target the MC to be repositioned after
on
(release)?


on (release) {
   something here I presume?
   endX = -500;
   endY = -200;
}
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com





--
João Carlos
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com