local attribute scope not working in html5 with onloaded

  • Code
    <layer name="social_facebook"	zorder="3"  url="%SWFPATH%/skin/facebook_64.jpg"	onover="tween(scale,1.1,easeOutBounce);" onout="tween(scale,1,easeOutBounce);"	align="lefttop" edge="center"	x="100"	y="89"	onloaded="txtadd(onclick,'blink();delayedcall(1,hidewindows();openurl(http://www.facebook.com/sharer.php?u=',get(tour_link),',_blank);)');"	/>

    No go in html5

    replacing onclick with layer[social_facebook].onclick works fine, tracing onclick in the same stroke traces fine, but the onclick for the layer is really empty. Also this layer is a child.

  • Hi,

    right there is a small difference here from Flash to HTML5 - the local scope itself is working, but access to local scope attributes is only possible when the attributes are already existing. In Flash the layer event attributes like onclick, ondown, onup, ... are already predefined (with null as initial value), but in HTML5 (currently) not. There these attributes will be created first when setting them in the xml.

    As workaround you could add an onclick="" to the <layer> xml, then attribute will be defined and the code will work in HTML5 too.

    This will be fixed in the next release. Then the HTML5 version will behave like the Flash version.

    Best regards,
    Klaus

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!