PDA

View Full Version : How to avoid reloading Ext.flash.Component swf inside a TabPanel whenever selected?



jayg
1 Feb 2013, 5:22 PM
I'm embedding a Flex app (.swf) inside a TabPanel using Ext.flash.Component. It loads fine, but the .swf reloads every time its tab is selected. Is there any way to prevent this?

inside the ViewPort:



{
id: 'tabs',
xtype: 'tabpanel',
items: [
{
id: 'tab1',
title: 'Tab 1',
xtype: 'flash',
url: '/test-embed.swf'
},
{
id: 'tab2',
title: 'Tab 2',
html: '[TBD]'
},
{
id: 'tab3',
title: 'Tab 3',
html: '[TBD]'
},
// ...
// ...

mitchellsimoens
4 Feb 2013, 1:13 PM
Should work just fine. When the tab is deactivated check out the DOM to see if the elements look fine.

jayg
4 Feb 2013, 1:40 PM
Yes, swf object remains in dom on deselect, however on reselect of its tab, network log clearly shows it being reloaded from the server (also evident since it loses its state).

jayg
21 Feb 2013, 3:57 PM
For anyone else, by trial and error I found that reloading will be skipped by adding the property:



hideMode : 'visibility'