SWF messenger - FireEvent triggers in swf

Working with Media (graphics, audio, video) & other Assets

Moderator: Nav

SWF messenger - FireEvent triggers in swf

Postby monmouthrider » Fri Apr 01, 2011 8:34 am

Nav,

I'm working on a wheel of fortune type game. I have built the spinning wheel in Flash and placed it on the stage inside a swf messenger, its working fine. Once the wheel has been clicked/spun the swf should sent one of six 'fireEvent's to Smartbuilder. I have put the six fireEvents inside the 'whatHit' function but I can't trigger anything inside the topic using actions. There is a trace output on the swf and everything looks OK (remove comments //).

I have also moved the fireEvents to frame 2 as I read something about them not working on frame 1.

I've used the swf messenger before for comms in and out and had no problems.

Could you look at the Wheel of Fortune topic (in Trevor White-Miller LGF) and the attached .fla and see what I'm doing wrong. These are just the cut down rough tests for a bigger game.

Trevor
Attachments

best_spin_working4.fla [ 190 KiB | Viewed 8208 times ]

monmouthrider
 
Posts: 30
Joined: Fri Mar 04, 2011 8:36 am

Re: SWF messenger - FireEvent triggers in swf

Postby Nav » Thu Apr 07, 2011 10:59 am

Hi Trevor,
So I had to give this over to one of our developers because the problem was beyond me. But he fixed it, and said this. Since this SWF is being loaded into SmartBuilder, which is a bigger SWF, your SWF needs to be designed to work in that framework from an AS perspective. Not that you explicitly used calls like _root, but some of Flash's default references got in your way.

  • You can use mx.utils.Delegate to preserve scope with function calls.
  • You need to perform hitTest with values transformed to the root or global.
Please find the corrected (though still with debugging functionality) FLA attached.

Also, this is a pretty handy little piece of functionality. Do you mind if we genericize it and make it available to the rest of the SmartBuilder community?

- Nav
Attachments

best_spin_working5 f8.fla [ 196 KiB | Viewed 8202 times ]

Nav
 
Posts: 866
Joined: Mon Nov 05, 2007 2:58 pm

Re: SWF messenger - FireEvent triggers in swf

Postby monmouthrider » Thu Apr 07, 2011 1:47 pm

Hi Nav, Many thanks for the fix, please pass my thanks to the SB developer as well. Quickly loaded it in and working fine.

Apart from being able to complete the design of the game interaction it has been a good exercise in understanding more about using the swf messenger with embedded flash files. I knew to avoid '_root' but was not sure how to reference up to the main smartbuilder swf.

Please feel free to use the code/concept in the community as required. The only restriction is the artwork of the spinning wheel which was cropped out of something else which I don't own. I was using this as a quick place holder to work on my actionscript. I'll be designing my own wheel with different categories. I think I can reuse the basic idea in a number of different ways.

Once again many thanks for the support, I'll be able to deliver the game I promised the client.

Trevor
monmouthrider
 
Posts: 30
Joined: Fri Mar 04, 2011 8:36 am

Re: SWF messenger - FireEvent triggers in swf

Postby Nav » Thu Apr 07, 2011 4:04 pm

Thank for the trade, Trevor. Yeah, when we go to use this, we'll definitely swap out the graphic with something else.

- Nav
Nav
 
Posts: 866
Joined: Mon Nov 05, 2007 2:58 pm


Return to Media & Assets

Who is online

Users browsing this forum: No registered users and 0 guests

cron
Not able to open ./cache/data_global.php