Closed GoogleCodeExporter closed 9 years ago
Callbacks are set on function call made from AS3, like:
C++ ->
m_flashInterface->AddCallback(L"SteamRelease", *this, &CSteamGame::SteamRelease);
AS3 ->
SteamReleaseControlButton.addEventListener(MouseEvent.MOUSE_DOWN, SteamMouseEventDown);
SteamReleaseControlButton.addEventListener(MouseEvent.MOUSE_UP, SteamMouseEventUp);
function SteamMouseEventDown(event:MouseEvent) : void
{
ExternalInterface.call("SteamRelease", true);
}
function SteamMouseEventUp(event:MouseEvent) : void
{
ExternalInterface.call("SteamRelease", false);
}
Original comment by max.dyac...@gmail.com
on 23 Apr 2010 at 3:49
For variables it looks like you are trying to Get() variable in different
context.
That's why Set() before Get() works for you. You need to ask some AS3 guru
about this.
Original comment by max.dyac...@gmail.com
on 23 Apr 2010 at 3:52
Calls works for me like:
C++ ->
m_flashInterface->Call(L"SetPowerIndicator", (f32)m_locoControl->GetUIPower());
AS3 ->
function SetPowerIndicator(power : Number) : void
{
PowerLevel.y = PowerLevelControlButton.y + (1 - power) *
PowerLevelControlButton.height;
}
ExternalInterface.addCallback("SetPowerIndicator", SetPowerIndicator);
Original comment by max.dyac...@gmail.com
on 23 Apr 2010 at 3:54
Sorry for late replies, for some reason defects editing doesn't provide me with
e-mail notification. =)
Original comment by max.dyac...@gmail.com
on 23 Apr 2010 at 3:55
Ok, so I've fixed e-mail notifications by now.
Original comment by max.dyac...@gmail.com
on 23 Apr 2010 at 3:59
Original issue reported on code.google.com by
roytu...@gmail.com
on 3 Apr 2010 at 10:01