1 (edited by aev5 2010-01-28 06:57:52)

Topic: Problem with clicks

Hi I made a widget http://www.chumby.com/guide/widget/Doggie%20Cam

I am completely new to Flash.  I started with the ChumbySpy template but added a feature that tilts/pans the webcam based on clicks at the edge (within 40px) of the video.

My clicks work to move the camera when I run my swf locally or via Chumby's XML movie path http://movies.chumby.com/xmlmovie/FFC6C … 1B24F07EF4 or on my own website http://www.chrisandannette.com/cna/CnAdoggieCamM.html

(The camera is not real fast, so click an edge once and be patient for a few seconds)

My clicks also work right after I upload the SWF when the widget is displayed to me on the "upload a widget" page.

However, when I browse Chumby's website to my widget, then the clicks do not work at all, ever!!  They also do not work on my Chumby.


Below is what I have for the clicks.  I can see that my "move the camera" URL is not called when the clicks are not working, so it's not a problem of communication with the webcam.   

Can anybody advise what I am doing regarding the clicks that is Flash-working but not Chumby-working (where I intended that an edge touch would tilt/pan the camera)? 

Thanks!


var mouseListener:Object = new Object();

mouseListener.onMouseDown = function() {
    trace ( "x: " + _xmouse + "  y: " + _ymouse );   
    var url = "http://www.chrisandannette.com/doggieca … rl.cgi?mv=";
    if (_root._ymouse < 40) {
        url = url + "U";
    }
    if (_root._ymouse > 200) {
        url = url + "D";
    }
    if (_root._xmouse < 40)
    {
        url = url + "L";
    }
    if (_root._xmouse > 280) {
        url = url + "R";
    }
    url = url + ",5";
    getURL(url);

}

Mouse.addListener(mouseListener);


Edit: Publish settings are Flash Lite 3.0, Action Script 2.0

Re: Problem with clicks

I have noticed when I uploaded a widget for the first time it is out there instantly.  But when I update the widget it can take 2-4 hours for it to update on my chumby and on the main widgets page.  I think someone has to approve of an update.

Re: Problem with clicks

Hi, thanks, I wondered about that, so I changed the "Loading..." text to "Loading Doggies..."  I do see that. Also I changed a parameter on my movie image loading URL and I can see that changed being used too.  So the latest version seems to be in use, but the clicks do not work via Chumby.com's website (except via the xmlmovie url where they do work) or on my Chumby itself.

Re: Problem with clicks

My thought is that Chumby *must* put a wrapper around my movie, so the question is probably how to detect mousedown through the Chumby wrapper?

Re: Problem with clicks

Using getURL to access that URL isn't the best method.  In the web browser, that tells the Flash movie to replace the web page that contains the movie with the URL you request.  It works in the standalone Flash player because there's no browser and they just mapped it to touch the URL without changing the context.

Instead use XML.load to touch that URL -- that won't disturb the browser setting.  However, it does mean you'll need a http://www.chrisandannette.com/crossdomain.xml file setup to allow access.  You can avoid this by instead trying to load an image or movie clip from that address, like

  var image:MovieClip = mc.createEmptyMovieClip("image", mc.getNextHighestDepth());
  image.loadMovie("URL TO TILT CONTROL");

I think that FlashLite doesn't need a crossdomain.xml to try to pull down an image, so that will success in accessing the tilt-control, but the actual movie load will fail.  (I may be wrong about that... I've not tried this yet myself).

Re: Problem with clicks

Hi unwiredben.. I made the change you suggested dropping the use of getURL in favor of loading as an image. 

I did not realize the suggestion was meant to solve to the failed clicking (rather than just that I was doing something poorly), but it sure seems to have fixed my problem!  Thank you!!!!!

So.. my onMouseDown works fine, but the getURL part was the failing part. Nuts!!