Feb
11
2009
Can`t really get my head around this, I`ve used a code snippet from an Adobe RSS reader example to sort the namespace of an RSS feed:
if (rssXML.namespace("") != undefined)
{
default xml namespace = rssXML.namespace("");
}
Then tried to load an image using a URL from it with a listener for load completion:
var ldr:Loader = new Loader()
var url:String = item.enclosure.@url;
var urlReq:URLRequest = new URLRequest(url);
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete)
ldr.load(urlReq);
contentHolder.addChild(ldr);>
public function onLoadComplete(event:Event):void
{
trace(event)
}
But this kept on throwing me an annoying error:
ReferenceError: Error #1069: Property namespace not found on flash.events.Event and there is no default value.
Only solution was commenting out the namespace bit. It might work with a different namespace declaration, but not with this, so beware
975 views | 2 comments | tags: #1069, actionscript 3.0, as3, Error, event, Flash and Flash Lite, namespace, rss | posted in Flash and Flash Lite
May
2
2008
Yesterday I ran into an issue with IE7 again (well, I assume not too many of you are surprised, ehh).
When I was trying to move an element in the DOM (actually update) with an other element’s innerHTML including a flash object, the movie (.swf) forgot to load. Right clicking on the flash file you can see the following message, greyed out:
“Movie not loaded”
This is an example snippet of the code:
<div id="video">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="184" height="140" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="bgcolor" value="999999" /><param name="quality" value="high" /><param name="allowScriptAccess" value="always" /><param name="allowNetworking" value="all" /><param name="src" value="/videos/15.swf" /><embed type="application/x-shockwave-flash" width="184" height="140" src="/videos/15.swf" allownetworking="all" allowscriptaccess="always" quality="high" bgcolor="999999"></embed></object></div>
<script type="text/javascript">
$("otherElement").update($("video").innerHTML);
</script>
Using IE7, Prototype 1.5 and Flash Player 9 on Windows XP.
This problem does not seem to occur in normal browsers (like Safari or Firefox), they load the movie file perfectly. I thought it would be good to share with others, maybe you guys know a workaround, or I can warn others before they will have to face the same problem.
997 views | 1 comment | tags: Flash and Flash Lite, Prototype | posted in Front-end
Dec
11
2007
If you ever want to use a custom mouse cursor in AS3 (for say dragging) with rollover/rollout events toggling it (so it will only change the cursor for certain movie-clips), bear this in mind:
When the user moves the mouse to the right with a certain (slowish) speed, the (original) hidden mouse cursor will go over the custom cursor, so it will fire the rollout event. Then when Flash updates the custom cursor position, the original mouse cursor won`t be over the custom one anymore, so it fires the rollout event, thus the cursor blinks quite noticeably. And no, the event.updateAfterEvent() won`t help either.
The workaround for this is to add the MouseEvent.MOUSE_MOVE listener to the stage and watch the event.target in the handler function and toggle the custom cursor using that, so you can specify that Flash shouldn`t do the toggling (= keep the custom cursor on) when the mouse goes over it.
So it isn`t necessarily a Flash Player bug, because this behavior makes sense (the mouse updates much more frequently than the .swf), but well annoying to figure out anyway.
2,133 views | 8 comments | tags: actionscript 3.0, as3, cursor, custom, Flash and Flash Lite, mouse | posted in Flash and Flash Lite
Dec
3
2007
I`ve ran into a rather annoying bug today, if you want to use either the _height or textHeight property of a textfield using device fonts and set to autoSize, it`ll add a phantom line, so will report the heights as if there was an extra line in the textfield.
The fix for it is quite random as well, you have to ADD a “\n” (=new line) at the end of your text and whooops, the phantom line is gone.
1,656 views | no comments, yet | tags: actionscript 2.0, as2, device font, Flash and Flash Lite, hack, height, textfield, textheight | posted in Flash and Flash Lite