Dear group,
I used the FIRPanel example code to put smooth fade in/out effects to
the title graphics of my site. You can see the current implementation
at
http://www.dotvoting.org
After discussions in another group, I've started to move my images to
a clientbundle and I adopted the FIRPanel to use ImageResource
information rather than an URL. The adopted parts are:
> public FIRPanel(ImageResource _firstImageResource, NEffect _swapApproach) {
> visImage = new Image();
> visImage.setResource( _firstImageResource ); // setResource instead of new Image(firstImageUrl);
>
> swapEffect = _swapApproach;
> swapPanel = new NEffectPanel();
> swapEffect.addEffectCompletedHandler(new EffectCompletedHandler(){
> public void onEffectCompleted(EffectCompletedEvent handler) {
> if (forward) {
> visImage.setResource(newImageResource); // setResource instead of setUrl
> forward = false;
> } else {
> forward = true;
> }
> }
> });
> [...] // untouched
> }
> public void swapImage(ImageResource _newImageResource) {
> this.newImageResource = _newImageResource; // replaced URL by ImageResource
> runEffect();
> }
This works fine using FF 3.6.4 and Safari 5. In IE 8, the image is not
shown. Also, in IE 8, on changing the image, a Javascript error is
thrown in IE. Debugging it shows that the Exception is thrown at the
line
> visImage.setResource(newImageResource); // setResource instead of setUrl
Using Image objects in combination with setResource outside of the FIR
panel perfectly works in IE 8. Also, switching IE 8 to "compatibiltiy
mode" works fine (thus, I assume that the implementation would work
with IE 7).
The only difference I see is that in my adopted version the content of
the image is set by resources not by an URL. The rest seems to be
untouched. Has anybody an explanation why using Image in NEffectPanel
seems to behave differently than using an Image outside of it?
Thanks
Sven