|
List Info
Thread: Drag Drop Color Swatches
|
|
| Drag Drop Color Swatches |
  United States |
2007-07-14 15:34:54 |
Hi,
"Googled" without success, for finding AS 2 or 3
code for creating
drag & drop swatches. The goal is having the source
swatch color an
object when dropped.
I'll retreat to my lab, while awaiting helpful replies.
CK
_______________________________________________
Flashnewbie chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om
|
|
| Re: Drag Drop Color Swatches |

|
2007-07-16 12:48:36 |
The approach would determine what methods to use.
If the swatch colors are predefined (placed in an array or
what ever) then
just use hit test and use the current dragged item which
should contain an
object or variable with the color, set the color of the mc
that has been hit
on mouse up.
or
Use the same method above but use bitmap data to select and
set the color.
<
http://livedocs.adobe.com/flash/9.0/main/wwhelp/
wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&fi
le=00001393.html
>
Basically you are going to use a few different methods to do
this -
startDrag and stopDrag
hitTest
get color and set color
set-
<
http://livedocs.adobe.com/flash/9.0/main/wwhelp/
wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&fi
le=00001535.html
>
post if you need any help or direction!
hth
B.
On 7/14/07, CK <ck bushidodeep.com> wrote:
>
> Hi,
>
> "Googled" without success, for finding AS 2
or 3 code for creating
> drag & drop swatches. The goal is having the source
swatch color an
> object when dropped.
>
> I'll retreat to my lab, while awaiting helpful
replies.
>
> CK
> _______________________________________________
> Flashnewbie chattyfig.figleaf.com
> To change your subscription options or search the
archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.c
om
>
_______________________________________________
Flashnewbie chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om
|
|
| Re: Drag Drop Color Swatches |
  United States |
2007-07-16 13:23:48 |
Hi,
After retreating to my lab:
[CODE]
stop ();
function DragDrop (cDrag)
{
cDrag.onMouseDown = function ()
{
startDrag (this);
};
cDrag.onMouseUp = function ()
{
this.stopDrag ();
};
}
//These types are simple strings, how can I type them as
MovieClip &
Color..
function colorTarget (tSwatch:String, cColor:String)
{
tColor = new Color (tSwatch);
tColor.setRGB (cColor);
}
DragDrop (swatch01_mc);
colorTarget (swatch01_mc,0x7979ff);
[/CODE]
It's just a start, However, it appears to be following in
your
suggestions light. Color and target can be assigned from an
array.
Please offer suggestions before the code goes astray.
CK
On Jul 16, 2007, at 12:48 PM, Bob Wohl wrote:
> The approach would determine what methods to use.
>
> If the swatch colors are predefined (placed in an array
or what
> ever) then
> just use hit test and use the current dragged item
which should
> contain an
> object or variable with the color, set the color of the
mc that has
> been hit
> on mouse up.
>
> or
>
> Use the same method above but use bitmap data to select
and set the
> color.
> <
> http://livedocs.adobe.com/flash/9.0/main/wwh
elp/wwhimpl/common/html/
>
wwhelp.htm?context=LiveDocs_Parts&file=00001393.html
>>
>
>
> Basically you are going to use a few different methods
to do this -
>
> startDrag and stopDrag
> hitTest
>
> get color and set color
> set-
> <
> http://livedocs.adobe.com/flash/9.0/main/wwh
elp/wwhimpl/common/html/
>
wwhelp.htm?context=LiveDocs_Parts&file=00001535.html
>>
>
>
> post if you need any help or direction!
>
> hth
> B.
>
>
>
>
>
> On 7/14/07, CK <ck bushidodeep.com> wrote:
>>
>> Hi,
>>
>> "Googled" without success, for finding AS
2 or 3 code for creating
>> drag & drop swatches. The goal is having the
source swatch color an
>> object when dropped.
>>
>> I'll retreat to my lab, while awaiting helpful
replies.
>>
>> CK
>> _______________________________________________
>> Flashnewbie chattyfig.figleaf.com
>> To change your subscription options or search the
archive:
>> http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
>>
>> Brought to you by Fig Leaf Software
>> Premier Authorized Adobe Consulting and Training
>> http://www.figleaf.com
>> http://training.figleaf.c
om
>>
> _______________________________________________
> Flashnewbie chattyfig.figleaf.com
> To change your subscription options or search the
archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.c
om
_______________________________________________
Flashnewbie chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om
|
|
| Re: Drag Drop Color Swatches |

|
2007-07-16 13:55:17 |
Saw a lot of errors there so i changed up the code a bit.
You will need the
hit item, I dont know what you planned on hitting, weither
it was one MC or
one of many, if so just loop through the MCs that are
hitable to change the
'changeMe_mc'. Also, you need to add a mc to the stage named
changeMe_mc and
then a few others named swatch01_mc - swatch03_mc to see
this work -
stop ();
var colorArray:Array = new
Array("0x7979ff","0x7900ff","0x79ff
ff");
var thisRoot:MovieClip = this;
function DragDrop (cDrag)
{
trace(cDrag)
cDrag.onPress = function ()
{
startDrag (this);
};
cDrag.onRelease = function ()
{
this.stopDrag ();
if (this.hitTest(changeMe_mc)) {
trace(this.colorId)
colorTarget (this, this.colorId);
}
};
}
function colorTarget (tSwatch:MovieClip, cColor:Number)
{
trace("here we are")
var my_color:Color = new Color(changeMe_mc);
tColor = new Color(tSwatch.colorId);
my_color.setRGB (cColor);
}
for(var i = 1;i<colorArray.length+1;i++){
thisRoot["swatch0"+i+"_mc"].colorId
= Number(colorArray[i-1])//0x7979ff
DragDrop
(thisRoot["swatch0"+i+"_mc"]);
//trace(thisRoot["swatch0"+i+"_mc"])
}
On 7/16/07, CK <ck bushidodeep.com> wrote:
>
> Hi,
>
> After retreating to my lab:
> [CODE]
>
> stop ();
>
> function DragDrop (cDrag)
> {
> cDrag.onMouseDown = function ()
> {
> startDrag (this);
>
>
> };
> cDrag.onMouseUp = function ()
> {
>
> this.stopDrag ();
> };
>
> }
>
>
>
> //These types are simple strings, how can I type them
as MovieClip &
> Color..
>
>
> function colorTarget (tSwatch:String, cColor:String)
> {
>
> tColor = new Color (tSwatch);
> tColor.setRGB (cColor);
>
>
>
>
> }
>
> DragDrop (swatch01_mc);
> colorTarget (swatch01_mc,0x7979ff);
> [/CODE]
>
>
> It's just a start, However, it appears to be following
in your
> suggestions light. Color and target can be assigned
from an array.
> Please offer suggestions before the code goes astray.
>
>
>
> CK
> On Jul 16, 2007, at 12:48 PM, Bob Wohl wrote:
>
> > The approach would determine what methods to use.
> >
> > If the swatch colors are predefined (placed in an
array or what
> > ever) then
> > just use hit test and use the current dragged item
which should
> > contain an
> > object or variable with the color, set the color
of the mc that has
> > been hit
> > on mouse up.
> >
> > or
> >
> > Use the same method above but use bitmap data to
select and set the
> > color.
> > <
> > http://livedocs.adobe.com/flash/9.0/main/wwh
elp/wwhimpl/common/html/
> >
wwhelp.htm?context=LiveDocs_Parts&file=00001393.html
> >>
> >
> >
> > Basically you are going to use a few different
methods to do this -
> >
> > startDrag and stopDrag
> > hitTest
> >
> > get color and set color
> > set-
> > <
> > http://livedocs.adobe.com/flash/9.0/main/wwh
elp/wwhimpl/common/html/
> >
wwhelp.htm?context=LiveDocs_Parts&file=00001535.html
> >>
> >
> >
> > post if you need any help or direction!
> >
> > hth
> > B.
> >
> >
> >
> >
> >
> > On 7/14/07, CK <ck bushidodeep.com> wrote:
> >>
> >> Hi,
> >>
> >> "Googled" without success, for
finding AS 2 or 3 code for creating
> >> drag & drop swatches. The goal is having
the source swatch color an
> >> object when dropped.
> >>
> >> I'll retreat to my lab, while awaiting helpful
replies.
> >>
> >> CK
> >>
_______________________________________________
> >> Flashnewbie chattyfig.figleaf.com
> >> To change your subscription options or search
the archive:
> >> http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
> >>
> >> Brought to you by Fig Leaf Software
> >> Premier Authorized Adobe Consulting and
Training
> >> http://www.figleaf.com
> >> http://training.figleaf.c
om
> >>
> > _______________________________________________
> > Flashnewbie chattyfig.figleaf.com
> > To change your subscription options or search the
archive:
> > http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
> >
> > Brought to you by Fig Leaf Software
> > Premier Authorized Adobe Consulting and Training
> > http://www.figleaf.com
> > http://training.figleaf.c
om
>
> _______________________________________________
> Flashnewbie chattyfig.figleaf.com
> To change your subscription options or search the
archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.c
om
>
_______________________________________________
Flashnewbie chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om
|
|
| Re: Drag Drop Color Swatches |
  United States |
2007-07-16 14:38:01 |
Hi,
No errors where returned to the output. Error as in elements
needed
for best practice. Anyway your solution was what as expected
of draft
(2). Thanks I'll post if any questions arise.
CK
On Jul 16, 2007, at 1:55 PM, Bob Wohl wrote:
> Saw a lot of errors there so i changed up the code a
bit. You will
> need the
> hit item, I dont know what you planned on hitting,
weither it was
> one MC or
> one of many, if so just loop through the MCs that are
hitable to
> change the
> 'changeMe_mc'. Also, you need to add a mc to the stage
named
> changeMe_mc and
> then a few others named swatch01_mc - swatch03_mc to
see this work -
>
> stop ();
> var colorArray:Array = new
Array("0x7979ff","0x7900ff","0x79ff
ff");
>
> var thisRoot:MovieClip = this;
>
> function DragDrop (cDrag)
> {
> trace(cDrag)
> cDrag.onPress = function ()
> {
>
> startDrag (this);
>
>
> };
> cDrag.onRelease = function ()
> {
>
> this.stopDrag ();
> if (this.hitTest(changeMe_mc)) {
> trace(this.colorId)
> colorTarget (this, this.colorId);
>
> }
>
> };
>
> }
>
>
>
> function colorTarget (tSwatch:MovieClip,
cColor:Number)
> {
> trace("here we are")
> var my_color:Color = new Color(changeMe_mc);
>
> tColor = new Color(tSwatch.colorId);
> my_color.setRGB (cColor);
>
>
>
>
> }
>
> for(var i = 1;i<colorArray.length+1;i++){
>
thisRoot["swatch0"+i+"_mc"].colorId =
Number(colorArray[i-1])//
> 0x7979ff
> DragDrop
(thisRoot["swatch0"+i+"_mc"]);
>
//trace(thisRoot["swatch0"+i+"_mc"])
> }
>
>
>
>
> On 7/16/07, CK <ck bushidodeep.com> wrote:
>>
>> Hi,
>>
>> After retreating to my lab:
>> [CODE]
>>
>> stop ();
>>
>> function DragDrop (cDrag)
>> {
>> cDrag.onMouseDown = function ()
>> {
>> startDrag (this);
>>
>>
>> };
>> cDrag.onMouseUp = function ()
>> {
>>
>> this.stopDrag ();
>> };
>>
>> }
>>
>>
>>
>> //These types are simple strings, how can I type
them as MovieClip &
>> Color..
>>
>>
>> function colorTarget (tSwatch:String,
cColor:String)
>> {
>>
>> tColor = new Color (tSwatch);
>> tColor.setRGB (cColor);
>>
>>
>>
>>
>> }
>>
>> DragDrop (swatch01_mc);
>> colorTarget (swatch01_mc,0x7979ff);
>> [/CODE]
>>
>>
>> It's just a start, However, it appears to be
following in your
>> suggestions light. Color and target can be assigned
from an array.
>> Please offer suggestions before the code goes
astray.
>>
>>
>>
>> CK
>> On Jul 16, 2007, at 12:48 PM, Bob Wohl wrote:
>>
>> > The approach would determine what methods to
use.
>> >
>> > If the swatch colors are predefined (placed in
an array or what
>> > ever) then
>> > just use hit test and use the current dragged
item which should
>> > contain an
>> > object or variable with the color, set the
color of the mc that has
>> > been hit
>> > on mouse up.
>> >
>> > or
>> >
>> > Use the same method above but use bitmap data
to select and set the
>> > color.
>> > <
>> > http://livedocs.adobe.com/flash/9.0/main/wwhelp/w
whimpl/common/
>> html/
>> >
wwhelp.htm?context=LiveDocs_Parts&file=00001393.html
>> >>
>> >
>> >
>> > Basically you are going to use a few different
methods to do this -
>> >
>> > startDrag and stopDrag
>> > hitTest
>> >
>> > get color and set color
>> > set-
>> > <
>> > http://livedocs.adobe.com/flash/9.0/main/wwhelp/w
whimpl/common/
>> html/
>> >
wwhelp.htm?context=LiveDocs_Parts&file=00001535.html
>> >>
>> >
>> >
>> > post if you need any help or direction!
>> >
>> > hth
>> > B.
>> >
>> >
>> >
>> >
>> >
>> > On 7/14/07, CK <ck bushidodeep.com> wrote:
>> >>
>> >> Hi,
>> >>
>> >> "Googled" without success, for
finding AS 2 or 3 code for creating
>> >> drag & drop swatches. The goal is
having the source swatch
>> color an
>> >> object when dropped.
>> >>
>> >> I'll retreat to my lab, while awaiting
helpful replies.
>> >>
>> >> CK
>> >>
_______________________________________________
>> >> Flashnewbie chattyfig.figleaf.com
>> >> To change your subscription options or
search the archive:
>> >> http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
>> >>
>> >> Brought to you by Fig Leaf Software
>> >> Premier Authorized Adobe Consulting and
Training
>> >> http://www.figleaf.com
>> >> http://training.figleaf.c
om
>> >>
>> >
_______________________________________________
>> > Flashnewbie chattyfig.figleaf.com
>> > To change your subscription options or search
the archive:
>> > http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
>> >
>> > Brought to you by Fig Leaf Software
>> > Premier Authorized Adobe Consulting and
Training
>> > http://www.figleaf.com
>> > http://training.figleaf.c
om
>>
>> _______________________________________________
>> Flashnewbie chattyfig.figleaf.com
>> To change your subscription options or search the
archive:
>> http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
>>
>> Brought to you by Fig Leaf Software
>> Premier Authorized Adobe Consulting and Training
>> http://www.figleaf.com
>> http://training.figleaf.c
om
>>
> _______________________________________________
> Flashnewbie chattyfig.figleaf.com
> To change your subscription options or search the
archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.c
om
_______________________________________________
Flashnewbie chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om
|
|
| Re: Drag Drop Color Swatches |

|
2007-07-16 14:46:47 |
say huh? my bad I guess...
On 7/16/07, CK <ck bushidodeep.com> wrote:
>
> Hi,
>
> No errors where returned to the output. Error as in
elements needed
> for best practice. Anyway your solution was what as
expected of draft
> (2). Thanks I'll post if any questions arise.
>
>
> CK
> On Jul 16, 2007, at 1:55 PM, Bob Wohl wrote:
>
> > Saw a lot of errors there so i changed up the code
a bit. You will
> > need the
> > hit item, I dont know what you planned on hitting,
weither it was
> > one MC or
> > one of many, if so just loop through the MCs that
are hitable to
> > change the
> > 'changeMe_mc'. Also, you need to add a mc to the
stage named
> > changeMe_mc and
> > then a few others named swatch01_mc - swatch03_mc
to see this work -
> >
> > stop ();
> > var colorArray:Array = new
Array("0x7979ff","0x7900ff","0x79ff
ff");
> >
> > var thisRoot:MovieClip = this;
> >
> > function DragDrop (cDrag)
> > {
> > trace(cDrag)
> > cDrag.onPress = function ()
> > {
> >
> > startDrag (this);
> >
> >
> > };
> > cDrag.onRelease = function ()
> > {
> >
> > this.stopDrag ();
> > if (this.hitTest(changeMe_mc)) {
> > trace(this.colorId)
> > colorTarget (this,
this.colorId);
> >
> > }
> >
> > };
> >
> > }
> >
> >
> >
> > function colorTarget (tSwatch:MovieClip,
cColor:Number)
> > {
> > trace("here we are")
> > var my_color:Color = new Color(changeMe_mc);
> >
> > tColor = new Color(tSwatch.colorId);
> > my_color.setRGB (cColor);
> >
> >
> >
> >
> > }
> >
> > for(var i = 1;i<colorArray.length+1;i++){
> >
thisRoot["swatch0"+i+"_mc"].colorId =
Number(colorArray[i-1])//
> > 0x7979ff
> > DragDrop
(thisRoot["swatch0"+i+"_mc"]);
> >
//trace(thisRoot["swatch0"+i+"_mc"])
> > }
> >
> >
> >
> >
> > On 7/16/07, CK <ck bushidodeep.com> wrote:
> >>
> >> Hi,
> >>
> >> After retreating to my lab:
> >> [CODE]
> >>
> >> stop ();
> >>
> >> function DragDrop (cDrag)
> >> {
> >> cDrag.onMouseDown = function ()
> >> {
> >> startDrag (this);
> >>
> >>
> >> };
> >> cDrag.onMouseUp = function ()
> >> {
> >>
> >> this.stopDrag ();
> >> };
> >>
> >> }
> >>
> >>
> >>
> >> //These types are simple strings, how can I
type them as MovieClip &
> >> Color..
> >>
> >>
> >> function colorTarget (tSwatch:String,
cColor:String)
> >> {
> >>
> >> tColor = new Color (tSwatch);
> >> tColor.setRGB (cColor);
> >>
> >>
> >>
> >>
> >> }
> >>
> >> DragDrop (swatch01_mc);
> >> colorTarget (swatch01_mc,0x7979ff);
> >> [/CODE]
> >>
> >>
> >> It's just a start, However, it appears to be
following in your
> >> suggestions light. Color and target can be
assigned from an array.
> >> Please offer suggestions before the code goes
astray.
> >>
> >>
> >>
> >> CK
> >> On Jul 16, 2007, at 12:48 PM, Bob Wohl wrote:
> >>
> >> > The approach would determine what methods
to use.
> >> >
> >> > If the swatch colors are predefined
(placed in an array or what
> >> > ever) then
> >> > just use hit test and use the current
dragged item which should
> >> > contain an
> >> > object or variable with the color, set
the color of the mc that has
> >> > been hit
> >> > on mouse up.
> >> >
> >> > or
> >> >
> >> > Use the same method above but use bitmap
data to select and set the
> >> > color.
> >> > <
> >> > http://livedocs.adobe.com/flash/9.0/main/wwhelp/w
whimpl/common/
> >> html/
> >> >
wwhelp.htm?context=LiveDocs_Parts&file=00001393.html
> >> >>
> >> >
> >> >
> >> > Basically you are going to use a few
different methods to do this -
> >> >
> >> > startDrag and stopDrag
> >> > hitTest
> >> >
> >> > get color and set color
> >> > set-
> >> > <
> >> > http://livedocs.adobe.com/flash/9.0/main/wwhelp/w
whimpl/common/
> >> html/
> >> >
wwhelp.htm?context=LiveDocs_Parts&file=00001535.html
> >> >>
> >> >
> >> >
> >> > post if you need any help or direction!
> >> >
> >> > hth
> >> > B.
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > On 7/14/07, CK <ck bushidodeep.com> wrote:
> >> >>
> >> >> Hi,
> >> >>
> >> >> "Googled" without success,
for finding AS 2 or 3 code for creating
> >> >> drag & drop swatches. The goal is
having the source swatch
> >> color an
> >> >> object when dropped.
> >> >>
> >> >> I'll retreat to my lab, while
awaiting helpful replies.
> >> >>
> >> >> CK
> >> >>
_______________________________________________
> >> >> Flashnewbie chattyfig.figleaf.com
> >> >> To change your subscription options
or search the archive:
> >> >> http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
> >> >>
> >> >> Brought to you by Fig Leaf Software
> >> >> Premier Authorized Adobe Consulting
and Training
> >> >> http://www.figleaf.com
> >> >> http://training.figleaf.c
om
> >> >>
> >> >
_______________________________________________
> >> > Flashnewbie chattyfig.figleaf.com
> >> > To change your subscription options or
search the archive:
> >> > http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
> >> >
> >> > Brought to you by Fig Leaf Software
> >> > Premier Authorized Adobe Consulting and
Training
> >> > http://www.figleaf.com
> >> > http://training.figleaf.c
om
> >>
> >>
_______________________________________________
> >> Flashnewbie chattyfig.figleaf.com
> >> To change your subscription options or search
the archive:
> >> http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
> >>
> >> Brought to you by Fig Leaf Software
> >> Premier Authorized Adobe Consulting and
Training
> >> http://www.figleaf.com
> >> http://training.figleaf.c
om
> >>
> > _______________________________________________
> > Flashnewbie chattyfig.figleaf.com
> > To change your subscription options or search the
archive:
> > http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
> >
> > Brought to you by Fig Leaf Software
> > Premier Authorized Adobe Consulting and Training
> > http://www.figleaf.com
> > http://training.figleaf.c
om
>
> _______________________________________________
> Flashnewbie chattyfig.figleaf.com
> To change your subscription options or search the
archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.c
om
>
_______________________________________________
Flashnewbie chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om
|
|
| Re: Drag Drop Color Swatches |
  United States |
2007-07-16 15:02:13 |
Hi,
No worries, the code worked, the MC color was set, the clip
could be
dragged. It just didn't have all the proper goodies. You
presented an
example that was very thorough. The goal I had set for this
evenings
trip to the "lab"
Thanks Again,
CK
On Jul 16, 2007, at 2:46 PM, Bob Wohl wrote:
> say huh? my bad I guess...
>
>
>
> On 7/16/07, CK <ck bushidodeep.com> wrote:
>>
>> Hi,
>>
>> No errors where returned to the output. Error as in
elements needed
>> for best practice. Anyway your solution was what as
expected of draft
>> (2). Thanks I'll post if any questions arise.
>>
>>
>> CK
>> On Jul 16, 2007, at 1:55 PM, Bob Wohl wrote:
>>
>> > Saw a lot of errors there so i changed up the
code a bit. You will
>> > need the
>> > hit item, I dont know what you planned on
hitting, weither it was
>> > one MC or
>> > one of many, if so just loop through the MCs
that are hitable to
>> > change the
>> > 'changeMe_mc'. Also, you need to add a mc to
the stage named
>> > changeMe_mc and
>> > then a few others named swatch01_mc -
swatch03_mc to see this
>> work -
>> >
>> > stop ();
>> > var colorArray:Array = new
Array("0x7979ff","0x7900ff","0x79ff
ff");
>> >
>> > var thisRoot:MovieClip = this;
>> >
>> > function DragDrop (cDrag)
>> > {
>> > trace(cDrag)
>> > cDrag.onPress = function ()
>> > {
>> >
>> > startDrag (this);
>> >
>> >
>> > };
>> > cDrag.onRelease = function ()
>> > {
>> >
>> > this.stopDrag ();
>> > if (this.hitTest(changeMe_mc))
{
>> > trace(this.colorId)
>> > colorTarget (this,
this.colorId);
>> >
>> > }
>> >
>> > };
>> >
>> > }
>> >
>> >
>> >
>> > function colorTarget (tSwatch:MovieClip,
cColor:Number)
>> > {
>> > trace("here we are")
>> > var my_color:Color = new
Color(changeMe_mc);
>> >
>> > tColor = new Color(tSwatch.colorId);
>> > my_color.setRGB (cColor);
>> >
>> >
>> >
>> >
>> > }
>> >
>> > for(var i = 1;i<colorArray.length+1;i++){
>> >
thisRoot["swatch0"+i+"_mc"].colorId =
Number(colorArray[i-1])//
>> > 0x7979ff
>> > DragDrop
(thisRoot["swatch0"+i+"_mc"]);
>> >
//trace(thisRoot["swatch0"+i+"_mc"])
>> > }
>> >
>> >
>> >
>> >
>> > On 7/16/07, CK <ck bushidodeep.com> wrote:
>> >>
>> >> Hi,
>> >>
>> >> After retreating to my lab:
>> >> [CODE]
>> >>
>> >> stop ();
>> >>
>> >> function DragDrop (cDrag)
>> >> {
>> >> cDrag.onMouseDown = function ()
>> >> {
>> >> startDrag (this);
>> >>
>> >>
>> >> };
>> >> cDrag.onMouseUp = function ()
>> >> {
>> >>
>> >> this.stopDrag ();
>> >> };
>> >>
>> >> }
>> >>
>> >>
>> >>
>> >> //These types are simple strings, how can
I type them as
>> MovieClip &
>> >> Color..
>> >>
>> >>
>> >> function colorTarget (tSwatch:String,
cColor:String)
>> >> {
>> >>
>> >> tColor = new Color (tSwatch);
>> >> tColor.setRGB (cColor);
>> >>
>> >>
>> >>
>> >>
>> >> }
>> >>
>> >> DragDrop (swatch01_mc);
>> >> colorTarget (swatch01_mc,0x7979ff);
>> >> [/CODE]
>> >>
>> >>
>> >> It's just a start, However, it appears to
be following in your
>> >> suggestions light. Color and target can be
assigned from an array.
>> >> Please offer suggestions before the code
goes astray.
>> >>
>> >>
>> >>
>> >> CK
>> >> On Jul 16, 2007, at 12:48 PM, Bob Wohl
wrote:
>> >>
>> >> > The approach would determine what
methods to use.
>> >> >
>> >> > If the swatch colors are predefined
(placed in an array or what
>> >> > ever) then
>> >> > just use hit test and use the current
dragged item which should
>> >> > contain an
>> >> > object or variable with the color,
set the color of the mc
>> that has
>> >> > been hit
>> >> > on mouse up.
>> >> >
>> >> > or
>> >> >
>> >> > Use the same method above but use
bitmap data to select and
>> set the
>> >> > color.
>> >> > <
>> >> > http://livedocs.adobe.com/flash/9.0/main/wwhelp/w
whimpl/common/
>> >> html/
>> >> >
wwhelp.htm?context=LiveDocs_Parts&file=00001393.html
>> >> >>
>> >> >
>> >> >
>> >> > Basically you are going to use a few
different methods to do
>> this -
>> >> >
>> >> > startDrag and stopDrag
>> >> > hitTest
>> >> >
>> >> > get color and set color
>> >> > set-
>> >> > <
>> >> > http://livedocs.adobe.com/flash/9.0/main/wwhelp/w
whimpl/common/
>> >> html/
>> >> >
wwhelp.htm?context=LiveDocs_Parts&file=00001535.html
>> >> >>
>> >> >
>> >> >
>> >> > post if you need any help or
direction!
>> >> >
>> >> > hth
>> >> > B.
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > On 7/14/07, CK <ck bushidodeep.com> wrote:
>> >> >>
>> >> >> Hi,
>> >> >>
>> >> >> "Googled" without
success, for finding AS 2 or 3 code for
>> creating
>> >> >> drag & drop swatches. The
goal is having the source swatch
>> >> color an
>> >> >> object when dropped.
>> >> >>
>> >> >> I'll retreat to my lab, while
awaiting helpful replies.
>> >> >>
>> >> >> CK
>> >> >>
_______________________________________________
>> >> >> Flashnewbie chattyfig.figleaf.com
>> >> >> To change your subscription
options or search the archive:
>> >> >> http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
>> >> >>
>> >> >> Brought to you by Fig Leaf
Software
>> >> >> Premier Authorized Adobe
Consulting and Training
>> >> >> http://www.figleaf.com
>> >> >> http://training.figleaf.c
om
>> >> >>
>> >> >
_______________________________________________
>> >> > Flashnewbie chattyfig.figleaf.com
>> >> > To change your subscription options
or search the archive:
>> >> > http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
>> >> >
>> >> > Brought to you by Fig Leaf Software
>> >> > Premier Authorized Adobe Consulting
and Training
>> >> > http://www.figleaf.com
>> >> > http://training.figleaf.c
om
>> >>
>> >>
_______________________________________________
>> >> Flashnewbie chattyfig.figleaf.com
>> >> To change your subscription options or
search the archive:
>> >> http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
>> >>
>> >> Brought to you by Fig Leaf Software
>> >> Premier Authorized Adobe Consulting and
Training
>> >> http://www.figleaf.com
>> >> http://training.figleaf.c
om
>> >>
>> >
_______________________________________________
>> > Flashnewbie chattyfig.figleaf.com
>> > To change your subscription options or search
the archive:
>> > http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
>> >
>> > Brought to you by Fig Leaf Software
>> > Premier Authorized Adobe Consulting and
Training
>> > http://www.figleaf.com
>> > http://training.figleaf.c
om
>>
>> _______________________________________________
>> Flashnewbie chattyfig.figleaf.com
>> To change your subscription options or search the
archive:
>> http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
>>
>> Brought to you by Fig Leaf Software
>> Premier Authorized Adobe Consulting and Training
>> http://www.figleaf.com
>> http://training.figleaf.c
om
>>
> _______________________________________________
> Flashnewbie chattyfig.figleaf.com
> To change your subscription options or search the
archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.c
om
_______________________________________________
Flashnewbie chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om
|
|
[1-7]
|
|