Skip to main content
Participant
June 1, 2008
Question

Calling functions of a SWF embedded within an HTML Text Field...

  • June 1, 2008
  • 3 replies
  • 412 views
I have a slideshow SWF of size 150px by 150px which changes image every 5 seconds with the use of a timer, the SWF has a kill() function which stops the timer.

In a larger content holding SWF I have a dynamically generated textfield which populates its htmlText property via an XML feed.

Within the htmlText I am inserting the slideshow SWF using the <img> tags... It all works great until I proceed to another page as there is no way to unload the slideshow SWF or call its kill() function which eventually lags the system as I have several heavy animations in the pages on ENTER_FRAMES.

Does anyone know how to unload a SWF or gain access to its functions which is embedded within htmlText...
This topic has been closed for replies.

3 replies

kglad
Community Expert
Community Expert
June 4, 2008
you must wait until your swf loads before trying to access its assets. you can then use the loaders only child to reference your swf's main timeline.
Participant
June 2, 2008
Thanks for replying :)

I tried that and using txt.getImageReference("idHere") I casted it to a loader object however it wont let me then get access to the SWFs functions...

I tried creating a sprite and using addChild() tried adding the loader to the sprite but it gave me cohesion errors...

Any other help MUCH appreciated
kglad
Community Expert
Community Expert
June 2, 2008
assign the swf an id in your img tag and use that to reference the swf.