Weird Looking: i hate actionscript

i hate actionscript

July 3, 2006 6:24am (5 years, 10 months and 2 weeks ago)
I needed to make a Flash movie containing pictures that could be dragged out onto the surrounding HTML elements.  And it almost worked, too.

You can pass information from Flash to HTML by sending the browser to a javascript: URL, so the idea was to trap the mouse-down event in Flash, then pass a message to the javascript telling it that it’s currently in a dragging state.  Replicate the dragging graphic in both Flash and HTML, and you can almost imagine this method working.

Except… if you try to drag something outside of Flash, it refuses to give the mouse events back.  Flash continues receiving events though, so you could theoretically pass those back to the browser yourself.  But calling getURL(’javascript:…’) to share the current mouse position causes IE to “click!” for every pixel the mouse moves.

I’m not really a Flash guy, so this may be possible via some other chicanery.  But based on currently available data, I’m going to call it a defeat.

Mike: 0, Flash: 1

Comments

Jul 3, 2006 12:05pm
It seems that SVG would be the ideal platform for what you are trying to do.  Seeing as that’s probably not an option (since you’re worried about the clicking in Internet Explorer), have you considered the <canvas> element?  There are workarounds that use Internet Explorer’s VML support to emulate the canvas.  It’s a terrible hack, but it gets the job done.

I actually prefer canvas over SVG, but I’ve always preferred immediate-mode graphics over retained-mode.  I suppose this has to do with all of the QBASIC programming I did as a kid.  If I had grown up with Flash and ActionScript, I’d probably prefer SVG.
Jul 3, 2006 5:24pm
SVG would be awesome for this, except for nobody being able to use it.  I didn’t know about the work done on emulating the canvas tag with VML, but I’ll definitely check it out tonight.  Thanks for the tip.

I wrote the app’s demo entirely in DHTML, but it’s painfully slow, and doing all of the graphics stuff with the HTML DOM is kind of unnatural and will probably be hell to maintain.  That’s why I was trying to redo everything in Flash.

I’ll be posting about this project later in the week, when we get our feeds and mailing list set up and have a demo worth showing off.
Jul 3, 2006 11:40pm
Have you considered Flex? I’m doing some work in it right now, but I’m really just starting so I’m not sure that this is even possible to do using that platform. But, Flex does compile the MXML(proprietary to Macrodobe) code into a SWF file.

Flex is still kind of new and I’m still kind of new to Flex, but it’s worth a shot. You can go to the adobe.com or macromedia.com websites and download the Flex SDK, it’s free. Also, you can use any language on the backend for database access and other stuff.

Just a thought. :D
Jul 4, 2006 1:28am
Flex would make it easier to write this small part, but I’d still be limited in my ability to interact with DHTML elements outside the movie.  And there are a lot of reasons not to write an entire site in Flash.

Leave a comment


Accepts BBCode with a few enhancements.