RE: [Flashcoders] Problems creating a drag and drop
Nevermind my last message... that was not the problem. The problem is my hit test. When I add the following code to determine whether the object is over the target, everything stops working: for (index= 0; index < count; index++) { trace(aButtons[index].hitTestObject(dropSpots[index])); } Even having it in there as a simple trace messes things up. Any ideas on how to accommodate the hitTest? Is there a different way to do a hit test in AS3? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lord, Susan, CTR, DSS Sent: Thursday, September 25, 2008 4:43 PM To: Flash Coders List Subject: RE: [Flashcoders] Problems creating a drag and drop Thanks for all of your suggestions. I ended up restructuring the code and adding the event listeners for the mouse up to the stage instead and took them out of the array. It seems to be working well (as long as I keep my mouse on the stage). I am very happy to have a working model! If anyone has any ideas for the occasion when the user moves the mouse off stage, that would be great! One sample I saw had the following in the stopDrag code --if (event.target == circle || circle.contains(event.target))--- But the contains code did not work for me. Below is my current code. Again thanks! ~~~ for (i= 0; i < count; i++) { aButtons[i].addEventListener(MouseEvent.MOUSE_DOWN, startDragging); aButtons[i].mouseChildren = false; } function startDragging(event:MouseEvent):void { for (i= 0; i < count; i++) { if (event.target == aButtons[i] ) { trace("start dragging"); aButtons[i].startDrag(); } stage.addEventListener(MouseEvent.MOUSE_UP, stopDragging); } } function stopDragging(event:MouseEvent):void { for (i= 0; i < count; i++) { if (event.target == aButtons[i] ) { trace("stop dragging"); aButtons[i] .stopDrag(); } } stage.removeEventListener(MouseEvent.MOUSE_UP, stopDragging); } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Problems creating a drag and drop
Thanks for all of your suggestions. I ended up restructuring the code and adding the event listeners for the mouse up to the stage instead and took them out of the array. It seems to be working well (as long as I keep my mouse on the stage). I am very happy to have a working model! If anyone has any ideas for the occasion when the user moves the mouse off stage, that would be great! One sample I saw had the following in the stopDrag code --if (event.target == circle || circle.contains(event.target))--- But the contains code did not work for me. Below is my current code. Again thanks! ~~~ for (i= 0; i < count; i++) { aButtons[i].addEventListener(MouseEvent.MOUSE_DOWN, startDragging); aButtons[i].mouseChildren = false; } function startDragging(event:MouseEvent):void { for (i= 0; i < count; i++) { if (event.target == aButtons[i] ) { trace("start dragging"); aButtons[i].startDrag(); } stage.addEventListener(MouseEvent.MOUSE_UP, stopDragging); } } function stopDragging(event:MouseEvent):void { for (i= 0; i < count; i++) { if (event.target == aButtons[i] ) { trace("stop dragging"); aButtons[i] .stopDrag(); } } stage.removeEventListener(MouseEvent.MOUSE_UP, stopDragging); } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] OT: Flex builder vs Flex SDK
Flexbuilder (the cheaper version) is the Eclpise programming tool with the ability to add and position components, as well as other tools like the memory profiler. The Flex SDK is mainly just a Flex .swf command-line compiler and support docs. BUT, you can use a tool like FlashDevelop (which has Flex MXML and Actionscript syntax support) to tap into the Flex SDK compiler to do Flex development for free (and it previews your Flex app too). In some ways, I think FlashDevelop is a superior code editor to Flexbuilder, however the downside is you don't have the ability to drag and drop components or the other things like memory profiling and such (the WYSIWYG feature of Flexbuilder is nice, but I hardly ever use it since it really only helps with initial UI design of your app IMO). But I've been using FlashDevelop for large Flex projects and never had any problems. The other thing about Flexbuilder is if you buy the more expensive version, you get all the charting components which don't come with the Flex SDK unfortunately. Jason Merrill Bank of America GCIB & Staff Support L&LD Instructional Technology & Media Join the Bank of America Flash Platform Developer Community Are you a Bank of America associate interested in innovative learning ideas and technologies? Check out our internal Innovative Learning Blog & subscribe. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Pedro Kostelec Sent: Thursday, September 25, 2008 2:54 PM To: Flash Coders List Subject: [Flashcoders] OT: Flex builder vs Flex SDK Hi I was wandering if starting to use Flex; but i can't see the difference between the FLex BUilder 3 and the FLex SDK. The Flex BUIlder shipps at 250$, so there must be quite some difference, right? Can someone point me to the most important differences between them two? A link to some good info perhaps? Thanks *Pedro D. Kostelec* [EMAIL PROTECTED] ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] OT: Flex builder vs Flex SDK
You can design visually with FlexBuilder, it's a great AS3 editor, you can maintain projects in it, etc. On Thu, Sep 25, 2008 at 2:54 PM, Pedro Kostelec <[EMAIL PROTECTED]> wrote: > Hi > > I was wandering if starting to use Flex; but i can't see the difference > between the FLex BUilder 3 and the FLex SDK. The Flex BUIlder shipps at > 250$, so there must be quite some difference, right? > Can someone point me to the most important differences between them two? A > link to some good info perhaps? > Thanks > > > *Pedro D. Kostelec* > [EMAIL PROTECTED] > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] OT: Flex builder vs Flex SDK
Flex SDK is the Software Development Kit (a development framework of classes). Flex Builder is an IDE (integrated development Environment) or better to say a program in which you can visually layout your GUI etc. So you might have come to the conclusion by yourself that Flex Builder uses the Flex SDK. Pedro Kostelec schrieb: Hi I was wandering if starting to use Flex; but i can't see the difference between the FLex BUilder 3 and the FLex SDK. The Flex BUIlder shipps at 250$, so there must be quite some difference, right? Can someone point me to the most important differences between them two? A link to some good info perhaps? Thanks *Pedro D. Kostelec* [EMAIL PROTECTED] ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] OT: Flex builder vs Flex SDK
Hi I was wandering if starting to use Flex; but i can't see the difference between the FLex BUilder 3 and the FLex SDK. The Flex BUIlder shipps at 250$, so there must be quite some difference, right? Can someone point me to the most important differences between them two? A link to some good info perhaps? Thanks *Pedro D. Kostelec* [EMAIL PROTECTED] ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Using Matrices?
Hey, just wondering if matrices make more sense in this situation and how you would apply them. So I'm just making a simple tic tac toe game - nothing major. I'm storing each x or o as a -1 or 1 in a grid like data structure. Of course, I could use a 2 dimensional array no problem - but wouldn't a matrix be more appropriate? Not only would I not have to dimension my nested arrays in a for/while loop - but I would assume that I could use some kind of matrix property to add up each column or row (again without a for/while loop). I haven't used (or can really find any information on matrices) for anything other than using them to transform bitmap data through the transformational methods. Thanks! ben ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] AS3 additions/changes in CS4?
What I don't get is why Adobe doesn't (or maybe they are working on it, but they haven't rolled it out yet) merge the two frameworks that compile into .swf format - Flash CS* and Flex. There are a lot of "gotchas" and workaround when using Flash inside of Flex for example, and the Flash CS* framework is seriously lacking in components. The Flex SDK is free, so it would seem that both compilers should use the same class framework to compile .swfs - that would make development with both tools a lot easier, and provide more features (especially to the Flash authoring tool). Jason Merrill Bank of America GCIB & Staff Support L&LD Instructional Technology & Media Join the Bank of America Flash Platform Developer Community Are you a Bank of America associate interested in innovative learning ideas and technologies? Check out our internal Innovative Learning Blog & subscribe. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Andrews Sent: Thursday, September 25, 2008 7:32 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 additions/changes in CS4? - Original Message - From: "Michael William Ypes" <[EMAIL PROTECTED]> To: "Flash Coders List" Sent: Thursday, September 25, 2008 11:10 AM Subject: Re: [Flashcoders] AS3 additions/changes in CS4? >I am curious. Why does the Adobe suite not come with Flex. It seems a bit >pointless to me. I use the whole of the master suite and flex. It seems to >be the only major product Adobe do that is not in the suite. > > Anyone know why??? I think Flex was always aimed at traditional developer who typically used a programming language but not a full creative toolset. Of course, that may be changing as more Flash developers use Flex also. I doubt Adobe sees it as any harm, after all they get you to pay for the Adobe suit AND for Flex.. > M ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Problems creating a drag and drop
Just a guess here... Try adding the event listeners to the draggable objects before you add them to your array and not in a for loop... see if that makes a difference. gregb -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lord, Susan, CTR, DSS Sent: Wednesday, September 24, 2008 3:55 PM To: Flash Coders List Subject: RE: [Flashcoders] Problems creating a drag and drop Thanks for the information. I think that may be part of my problem. I tried out the code on that site and Flash does not like the following circle.contains(event.target) If I take that out the code runs, but of course doesn't work. Does anyone know where I can find a good example on how to do a drag and drop in as3? I never had issues with this in 2. Thanks! Susan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Matt S. Sent: Wednesday, September 24, 2008 3:25 PM To: Flash Coders List Subject: Re: [Flashcoders] Problems creating a drag and drop You might need to add the "releaseOutside" hack for AS3, since there is no releaseOutside anymore: http://www.kirupa.com/forum/showthread.php?p=1948182#post1948182 On Wed, Sep 24, 2008 at 2:43 PM, Lord, Susan, CTR, DSS <[EMAIL PROTECTED]> wrote: > Hi there, > > I am having problems with my event listener for my drag and drop. > Sometimes it detects the mouse up event and sometimes it doesn't and > won't let go of the object (stopDrag). Have any of you ever run into > this? If so, is there a fix? > > Basically I have this coding... > > function stopDragging(event:MouseEvent):void { >trace("mouse up") >// There is more function code I just didn't want to paste > it all in. > } > > Triggered by: > > for (i= 0; i < aButtons.length; i++) { >aButtons[i].mouseChildren = false; >aButtons[i].addEventListener(MouseEvent.MOUSE_DOWN, > startDragging); >aButtons[i].addEventListener(MouseEvent.MOUSE_UP, stopDragging); > > } > > Any ideas? > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 additions/changes in CS4?
- Original Message - From: "Michael William Ypes" <[EMAIL PROTECTED]> To: "Flash Coders List" Sent: Thursday, September 25, 2008 11:10 AM Subject: Re: [Flashcoders] AS3 additions/changes in CS4? I am curious. Why does the Adobe suite not come with Flex. It seems a bit pointless to me. I use the whole of the master suite and flex. It seems to be the only major product Adobe do that is not in the suite. Anyone know why??? I think Flex was always aimed at traditional developer who typically used a programming language but not a full creative toolset. Of course, that may be changing as more Flash developers use Flex also. I doubt Adobe sees it as any harm, after all they get you to pay for the Adobe suit AND for Flex.. M ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Pause/Play a swf
I get it. We decided not to included this capability, but this will be a great exercise for me. For the audience that needs that kind of control, we're converting to a movie and will let others overlay controls. Thanks. On Sep 24, 2008, at 11:41 PM, sebastian wrote: It's not that complicated once you get your head around it. If you can write a function that stops and starts your movie from INSIDE the movie, then you can call that same function from OUTSIDE of it, just by referencing the name of the MC and then the function you want to call. So break it into steps, to make it simple and thus achievable: 1. figure out how to start and stop timers 2. put that in a function 3. test the function w/i the MC by having it call its own function 4. put that movie in the holding MC and then do another test to call that function, see same results 5. skin your function in the holding MC as a button, interface etc. Good luck! Seb. Jim Elmore wrote: This is getting very deep for me. The movie clips have timers that would have to stop, and I don't know I would tell a timer to stop and resume that is running in another movie clip. Perhaps I've built this wrong. On Sep 24, 2008, at 5:03 PM, sebastian wrote: Yes it is, but, erm, it's really hard to answer your question because there is no one way to implement it and, I have no idea how your scripted movie clips are running themselves... If each of your sub movies has a function that starts/pauses the playback, then you can simply have the parent MC call the currently loaded scripted MC's pause/play function. Something like: Main clip: this.loadedClip.pausePlay() And inside of the sub movie (container): public function pausePlay ():Boolean { this.stop(); //do something to pause playback, in this case just 'stop()' but depending on how you wrote this code, it might be something else like "resetTimer();" or ... return true; //if successful or if paused [depending on what you wan to //check when debugging] } Hope this helps a little. :) Seb. Jim Elmore wrote: I have a slide show built of scripted movie clips placed on the main timeline to sync to a voice over audio. This is way over my head, but I'd like to add play/pause functionality and a scrubber to this show. Is that possible to start and stop scripted movie clips from any frame in the swf? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 additions/changes in CS4?
I am curious. Why does the Adobe suite not come with Flex. It seems a bit pointless to me. I use the whole of the master suite and flex. It seems to be the only major product Adobe do that is not in the suite. Anyone know why??? M On 25 Sep 2008, at 04:18, Merrill, Jason wrote: Yeah, I get tired of doing this just to get code completion: var thisCustomObject:CustomObject = myObjects[i] as CustomObject; thisCustomObject.alpha = .5 Besides the obvious type checking benefits, with Vectors, I won't have to do it that way anymore to get good code completion from what I have read about them since the array knows the types it contains. From what I understand about them anyway, haven't had a chance to use them yet. Jason Merrill Bank of America GCIB & Staff Support L&LD Instructional Technology & Media Join the Bank of America Flash Platform Developer Community Are you a Bank of America associate interested in innovative learning ideas and technologies? Check out our internal Innovative Learning Blog & subscribe. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] ] On Behalf Of Zeh Fernando Sent: Wednesday, September 24, 2008 10:21 PM To: Flash Coders List Subject: Re: [Flashcoders] AS3 additions/changes in CS4? Also autocompletion and member verification and such for IDEs like FDT and FlashDevelop since it already knows the type of each list item. It's a god-given once you get used to it. I've been using Vectors like there's no tomorrow on a particular project of mine and it's really awesome. Going back to arrays is just weird, feels like I'm going back to AS2. Zeh On Wed, Sep 24, 2008 at 5:58 PM, Paul Andrews <[EMAIL PROTECTED]> wrote: - Original Message - From: "Mendelsohn, Michael" < [EMAIL PROTECTED]> To: "Flash Coders List" Sent: Wednesday, September 24, 2008 8:44 PM Subject: RE: [Flashcoders] AS3 additions/changes in CS4? Not sure what strongly typed arrays are. What are the advantages? Being able to type the array means not having to cast array members and detecting problems at compile time rather run time. OOooh - strongly typed arrays! Awesome! I've been waiting for that for a long time! Sweet. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 additions/changes in CS4?
Yep, forgot about the Vectors, sorry. Question is: when do we use simple arrays now? I mean, if Vectors are good both at compile and run times, why use Arrays at all? I've been loving typed arrays since MTASC introduced the syntax in AS2: var a:/*MovieClip*/Array Cheers! Juan On Thu, Sep 25, 2008 at 4:18 AM, Merrill, Jason <[EMAIL PROTECTED]> wrote: > Yeah, I get tired of doing this just to get code completion: > > var thisCustomObject:CustomObject = myObjects[i] as CustomObject; > thisCustomObject.alpha = .5 > > Besides the obvious type checking benefits, with Vectors, I won't have to do > it that way anymore to get good code completion from what I have read about > them since the array knows the types it contains. From what I understand > about them anyway, haven't had a chance to use them yet. > > Jason Merrill > Bank of America > GCIB & Staff Support L&LD > Instructional Technology & Media > Join the Bank of America Flash Platform Developer Community > Are you a Bank of America associate interested in innovative learning ideas > and technologies? > Check out our internal Innovative Learning Blog & subscribe. > > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Zeh Fernando > Sent: Wednesday, September 24, 2008 10:21 PM > To: Flash Coders List > Subject: Re: [Flashcoders] AS3 additions/changes in CS4? > > Also autocompletion and member verification and such for IDEs like FDT and > FlashDevelop since it already knows the type of each list item. It's a > god-given once you get used to it. I've been using Vectors like there's no > tomorrow on a particular project of mine and it's really awesome. Going back > to arrays is just weird, feels like I'm going back to AS2. > > Zeh > > On Wed, Sep 24, 2008 at 5:58 PM, Paul Andrews <[EMAIL PROTECTED]> wrote: > >> - Original Message - From: "Mendelsohn, Michael" < >> [EMAIL PROTECTED]> >> To: "Flash Coders List" >> Sent: Wednesday, September 24, 2008 8:44 PM >> Subject: RE: [Flashcoders] AS3 additions/changes in CS4? >> >> >> Not sure what strongly typed arrays are. What are the advantages? >>> >> >> Being able to type the array means not having to cast array members and >> detecting problems at compile time rather run time. >> >> >> >>> OOooh - strongly typed arrays! Awesome! I've been waiting for that >>> for a long time! Sweet. >>> >>> ___ >>> Flashcoders mailing list >>> Flashcoders@chattyfig.figleaf.com >>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >>> >>> >> ___ >> Flashcoders mailing list >> Flashcoders@chattyfig.figleaf.com >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >> > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > -- Juan Delgado - Zárate http://zarate.tv http://dandolachapa.com http://loqueyosede.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders