[Flashr] Running Flashr in Flash CS3 debugger
Brendan Dowling
bdowling at gmail.com
Wed Nov 19 12:33:08 PST 2008
Kelvin,
Thanks for your quick response and quick fix. That is indeed some
strange behavior. I'm now up and running (and debugging) with the
latest svn code.
Thanks,
Brendan Dowling
On Tue, Nov 18, 2008 at 11:28 PM, Kelvin Luck <kelvin at kelvinluck.com> wrote:
> Hi,
>
> That seems really strange... I haven't really used the debugger in CS3 but there is no reason it should behave differently to test movie... The only thing I can think of is that it uses a different version of the player...
>
> I've just done some further investigations and something very strange is going on when you run the movie in the debugger. Somehow all of the getters on the Flashr object are being called before the constructor... BUT they appear to have a reference to a valid Flashr object (which shouldn't exist until the constructor is called).
>
> For example, I added a line like this into various getters:
>
> trace ('Flashr get cache() this=' + this);
>
> And when I run in test movie mode I get this output when running in debug mode:
>
> Flashr get cache() this=[com.kelvinluck.flashr.core.Flashr]
> Flashr get history() this=[com.kelvinluck.flashr.core.Flashr]
> Flashr get queue() this=[com.kelvinluck.flashr.core.Flashr]
> Flashr constructor this=[com.kelvinluck.flashr.core.Flashr]
>
> When I run in normal test movie mode the output is:
>
> Flashr constructor this=[com.kelvinluck.flashr.core.Flashr]
>
> And then if I do search I get:
>
> Searching for 10 photos matching tag 'a'
> Flashr get cache() this=[com.kelvinluck.flashr.core.Flashr]
> Flashr get cache() this=[com.kelvinluck.flashr.core.Flashr]
> Flashr get queue() this=[com.kelvinluck.flashr.core.Flashr]
> Flashr get cache() this=[com.kelvinluck.flashr.core.Flashr]
> etc etc
>
> So the getters aren't called until they are needed...
>
> This is pretty crazy behaviour from the debugger. You can see why it would need to call the getters to display values but for it to do this on objects before they are even constructed (and for the objects to somehow believe they exist) is very werid... I've googled around but I can't find any reference to the problem anywhere else... So I'm afraid I'm not sure what to suggest... I don't have a copy of Flash 8 here to see if the problem also happens there or not...
>
> OK. I went through the Flashr code and I managed to fix it:
>
> https://mirror1.cvsdude.com/trac/osflash/flashr/changeset/92
>
> The change in FlashrRequest is definitely required, I'm not sure about the others... I'd recommend grabbing the latest code from svn just to be on the safe side...
>
> Thanks for the interesting bug report - surprised no-one seems to have run into it before,
>
> Cheers,
>
> Kelvin :)
>
>
>
> On Tue, 18 Nov 2008 19:36:13 -0800, Brendan Dowling <bdowling at gmail.com> wrote:
>
>> Hello,
>>
>> I'm new to this list and to using Flashr. I'm trying to build and run
>> FlashrSimpleSearch using Adobe Flash CS3. It builds and runs
>> perfectly fine in Test mode (Ctrl-Enter). However, running it in the
>> debugger leads to different behavior. I realize that there is a
>> possibility that using Flash CS3 just isn't supported (likely) and I
>> may have to track down a copy of Flash 8 or Flash MX 2004?
>>
>> Here is the head of the output when running in Test mode (works fine):
>> *DEBUG*:"[com.kelvinluck.flashr.core.Flashr] created"
>> *DEBUG*:"[com.kelvinluck.flashr.core.FlashrApiResponse]created"
>> *DEBUG*:"API Key set to: b40e05adf210ad4c4cc4da00f99*****"
>> *DEBUG*:"com.kelvinluck.flashr.core.FlashrResponse instance created"
>> Searching for 10 photos matching tag 'hello'
>> *DEBUG*:"[com.kelvinluck.flashr.core.FlashrRequest - 1
>> {flickr.photos.search}] generated"
>> *DEBUG*:"Flashr.callMethod :
>> http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=b40e05adf210ad4c4cc4da00f99f4184&per_page=10&tags=hello&"
>> ...
>> (output continues successfully after this)
>>
>>
>> Here is the output when running in the Debugger:
>> *DEBUG*:"[com.kelvinluck.flashr.core.FlashrCache] created"
>> *DEBUG*:"[com.kelvinluck.flashr.core.Flashr] created"
>> *DEBUG*:"[com.kelvinluck.flashr.core.FlashrApiResponse]created"
>> *DEBUG*:"API Key set to: b40e05adf210ad4c4cc4da00f99*****"
>> *DEBUG*:"com.kelvinluck.flashr.core.FlashrResponse instance created"
>> Searching for 10 photos matching tag 'hello'
>> *DEBUG*:"[com.kelvinluck.flashr.core.FlashrRequest - 1
>> {flickr.photos.search}] generated"
>> *DEBUG*:"Flashr.callMethod :
>> http://api.flickr.com/services/rest/?api_key=b40e05adf210ad4c4cc4da00f99f4184&"
>> *DEBUG*:"Flashr.onAPIResponse received XML: <?xml version="1.0"
>> encoding="utf-8" ?><rsp stat="fail"><err code="112" msg="Method
>> "unknown" not found" /></rsp>"
>> *ERROR*:"112: Method "unknown" not found when calling 'flickr.photos.search'"
>>
>>
>> Here is what I have noticed.
>> 1. For some reason it is creating the FlashrCache object even though
>> _flashr.cacheQueries = false; in FlashrSimpleSearch.as:
>> 2. If I break on the creation of FlashrCache object, here is the backtrace:
>> FlashrCache()
>> FlashrCache::getInstance()
>> __get__cache()
>> Flashr::getFlashr()
>> FlashrSimpleSearch()
>>
>> 3. If I start the app in the debugger, then close the debugger, it
>> works fine.
>>
>>
>>
>>
>> Thanks for your help.
>>
>>
>> Brendan Dowling
>>
>> _______________________________________________
>> Flashr mailing list
>> Flashr at osflash.org
>> http://osflash.org/mailman/listinfo/flashr_osflash.org
>>
>
>
>
>
> _______________________________________________
> Flashr mailing list
> Flashr at osflash.org
> http://osflash.org/mailman/listinfo/flashr_osflash.org
>
More information about the Flashr
mailing list