Open Herschel opened 3 years ago
@Herschel, as for AS2, menu
might be already implemented.
I mean, https://www.mejorar-presentaciones.tk/mejorar-presentaciones-loader.swf contains (besides a new ContextMenuItem()
):
new_context = new ContextMenu();
new_context.hideBuiltInItems();
Thanks to the work of @adrian17 with #4173, the last standard context menu items (“Enter fullscreen” and “About Ruffle…”) are displayed, besides the new ContextMenuItem()
.
Flash player also removes the playing context menu items when .hideBuiltInItems()
is invoked, but leaves “Settings…”, “Global settings…” and “About Adobe Flash Player…”.
Many thanks for your excellent work.
I think the point was about frontend (DOM) API, not AS; I didn't add menu
support to the embed API.
Sorry, in that case I totally missed the point.
For menu="0", my personal preference as a user would be for the full screen button to still be available even when there are no other menu items, as it's useful on my animations but Forward/Reverse/Play don't work right. As the developers Ruffle may prefer to still have the About Ruffle button too. So my preferred version of that polyfill setting would be to have the old context menu back, but others may have different preferences.
I just experimented a bit with the align
attribute - it seems to match what's described here.
Here is an example:
<div style="width: 1000px; height: 1000px;">
Hello world
<object type="application/x-shockwave-flash" data="ruffle-logo.swf" align="middle" width="640" height="480"><param name="allowscriptaccess" value="always"><param name="movie" value="ruffle-logo.swf"></object>
Hello again
</div>
Here is the result:
And here is the result of using align="right"
instead:
I also tested values of l
, t
, and r
since this Adobe documentation implied that it should work. It did not, and it doesn't match what the Flash editor generates either. You can choose the align
value via the "HTML alignment" in the Publish Settings:
I just tested the behavior of the browserZoom
attribute, and it is very strange. At first I thought it didn't do anything because I didn't see any change when I added it to my Flash embed from above. But then I found this page:
Updated the embed code to prevent display bugs in Flash Player caused by a browser zoom level other than the default 100%.
- More technically, added a param tag named "browserzoom" with value "noscale" which disables browser zoom on the game.
- This now also applies to all embed codes on the website, for all versions of the game.
And indeed, zooming in and out of the game page with Flash Player enabled does not scale the Flash content. After a lot more experimenting, here's what I found:
scale
attribute of the embed to noscale
disables scaling via browser zoom and via changing the embed size. Setting browserzoom
to scale
re-enables scaling via browser zoom. Other scale
values have no effect on browser zoom. Setting browserzoom
to noscale
without setting scale
has no effect.noScale
via ActionScript, then changing the embed size does not scale the Flash content, but browser zoom does scale the Flash content. Setting browserzoom
to noscale
disables scaling via browser zoom.browserzoom
value is completely ignored.
This is a tracking issue for supporting the attributes that could be placed on the Flash embed/object tag: https://helpx.adobe.com/flash/kb/flash-object-embed-tag-attributes.html
The polyfill should honor these settings. They can be passed along to the Ruffle core via the config block, which also allows the JS API to use them.
In somewhat order of importance:
src
/movie
width
height
flashVars
: Parameters passed to AS.allowScriptAccess
: Disable JS calls from AS.base
: Set the base URL for network requestswmode
:transparent
is often used (#1752). Do we care aboutopaque
vswindow
? Ignoregpu
/direct
.allowFullScreen
: allow/disallow fullscreen requests from ASallowFullScreenInteractive
: Allow StageDisplayState.FULL_SCREEN_INTERACTIVE. (May want to ignore in favor ofallowFullScreen
.)fullScreenAspectRatio
: Control orientation on mobile in fullscreen modemenu
: Hide built-in context menu items (Should we make this disable the context menu completely?)scale
: Stage.scaleModesalign
: Stage.alignplay
: Stop/play root timelineloop
: Loop root timelinealign
: Controls alignment if window is smaller than Flash viewport? Needs investigationbrowserZoom
: Controls size changes when browser DPI changes? Needs investigationquality
: Stage.quality