My client request a flash header for his website. I'm using asp.net and a master page (where the code for the flash header is). My problem is that whenever I go to a page that's not in the website's root, the flash doesn't appear. I've had the same issue with pure css menus on this site...
Here's the code:
<div id="header">
<!--[if !IE]> -->
<object type="application/x-shockwave-flash"
data="App_Themes/Default/banner1.swf" width="1000" height="400">
<!-- <![endif]-->
<!--[if IE]>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
width="1000" height="400">
<param name="movie" value="App_Themes/Default/banner1.swf" />
<embed src="App_Themes/Default/banner1.swf" width="1000" height="400"></embed>
<!--><!--dgx-->
<param name="loop" value="true" />
<param name="menu" value="false" />
<p></p>
</object>
<!-- <![endif]-->
</div>
As you can see, I'm not calling the path to the flash object relative to the website root (in case this isn't clear... if it were an asp.net control, I'd use ~/App_Themes/Default/banner1.swf")
The flash object is being loaded relative to the location of the current page that's being viewed on the website. Assuming an indeterminate folder depth from root, how can I change the code to load the flash relative to the root, rather than the current page?
I have considered changing the path that's being used by perpending / or ~/ to it, but this only results in the flash not loading on any page at all.
Looking at the source code, the server modifies /App_Themes/Default/banner1.swf to ~/App_Themes/Default/banner1.swf
Sticking a ~/ in a plain URL won't work. Try using this:
<object type="application/x-shockwave-flash"
data="<%=ResolveUrl('~/App_Themes/Default/banner1.swf')%>"
width="1000" height="400">
Related
My add-in loads properly with Word on Windows, but shows loading errors through Word Online (tested with Chrome, Firefox & Edge) even though clicking through the prompt buttons eventually loads the add-in and everything works as expected. This is what I am seeing in the add-in just loading a usage page (https://office.flexxlegal.com/Home/Usage):
Page loads in the taskpane with a grey overlay & loading animation
Receive Add-in Error message - Something went wrong and we couldn't start this add-in. Please try again later or contact your system administrator.
Click the Retry button
Page is displayed again in the taskpane with the overlay and loading animation
Receive Add-in Error message - This add-in may not load properly, but you can still try to start it.
Click the Start button
The page loads and everything works as expected
Here are the parts of the app manifest related to his control:
<Control xsi:type="Button" id="Flexx.Help">
<Label resid="Flexx.Help.Label" />
<Supertip>
<!-- ToolTip title. resid must point to a ShortString resource. -->
<Title resid="Flexx.Help.Label" />
<!-- ToolTip description. resid must point to a LongString resource. -->
<Description resid="Flexx.Help.Tooltip" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Flexx.qicon_16x16" />
<bt:Image size="32" resid="Flexx.qicon_32x32" />
<bt:Image size="80" resid="Flexx.qicon_80x80" />
</Icon>
<!-- This is what happens when the command is triggered (E.g. click on the Ribbon). Supported actions are ExecuteFunction or ShowTaskpane. -->
<Action xsi:type="ShowTaskpane">
<TaskpaneId>FLTaskPane</TaskpaneId>
<!-- Provide a url resource id for the location that will be displayed on the task pane. -->
<SourceLocation resid="Flexx.Help.Url" />
</Action>
</Control>
<Resources>
<bt:Images>
<bt:Image id="Flexx.qicon_16x16" DefaultValue="https://office.flexxlegal.com/assets/img/Q16.png" />
<bt:Image id="Flexx.qicon_32x32" DefaultValue="https://office.flexxlegal.com/assets/img/Q32.png" />
<bt:Image id="Flexx.qicon_80x80" DefaultValue="https://office.flexxlegal.com/assets/img/Q80.png" />
</bt:Images>
<bt:Urls>
<bt:Url id="Flexx.Help.Url" DefaultValue="https://office.flexxlegal.com/Home/Usage" />
</bt:Urls>
<!-- ShortStrings max characters==125. -->
<bt:ShortStrings>
<bt:String id="Flexx.Help.Label" DefaultValue="Getting Started" />
</bt:ShortStrings>
<!-- LongStrings max characters==250. -->
<bt:LongStrings>
<bt:String id="Flexx.Help.Tooltip" DefaultValue="Click to view usage information to get started with this FlexxLegal add-in." />
</bt:LongStrings>
</Resources>
With the webpage being loaded there is no code-behind, no javascript, just a static HTML page. Any insight into what the issue might be, or how I would go about determining the issue?
Thanks,
Ryan
With the webpage being loaded there is no code-behind, no javascript, just a static HTML page
This is your issue. Your add-in's pages must reference the office.js library and include an Office.initialize handler.
I suggest reviewing the documentation for instructions on how Office Web Add-ins work: Understanding the JavaScript API for Office.
I know there are methods to refresh the browser page from silverlight
like HtmlPage.Window.Navigate(HtmlPage.Document.DocumentUri); OR
System.Windows.Browser.HtmlPage.Document.Submit();
And these work fine when the container page use the total space in the page,
but what about when my silverlight app is located on a child page that belong to a some kind of master page? i.e. In the code bellow I have a page called Application.aspx that have three sections (main.aspx is where my silvelight app is located).
<frameset >
<frame id=frameTitle name=frameTitle src="title.aspx" noResize scrolling="no" frameborder="no" height="75" />
<frame name="frameSpacer" id="frameSpacer" src="spacer.aspx" noresize scrolling="no" marginwidth="0" marginheight="0"/>
<frame id="frameMain" name="frameMain" src="main.aspx" noResize scrolling=no frameborder="no" />
</frameset>
How can I refresh Application.aspx and not just Main.aspx (when i use Document.Submit() i got a partial refresh for main.aspx)? using other method?
Thank you in advance.
Solution: from the container aspx page we need to add a js function:
function reload() {
window.parent.location.reload(true);
}
from silverlight: we need to add a call to the js function "reload"
HtmlPage.Window.Invoke("reload");
I have embedded silverlight control in my html page using object tag. I have to show and hide the parent of object tag by changing the display property of the parent tag. I need to do this because the layout of the page is tabbed, i.e. user can switch between tabs. Showing a tab requires to hide the content of previous tab and show the new content.
Below is the object tag code:
<div id="slControlDiv" style="width:0px; height:0px;">
<object id="slobj" data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100" height="25" style="display: block;">
<param name="source" value="ILCFileUploader.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="4.0.50826.0" />
<param name="autoUpgrade" value="true" />
</object>
When I hide the parent of object tag, i.e change the display to none and then show it back by changing display to block or empty, silverlight control reloads.
Is there anyway to prevent its reloading? I have tried changing visibility to collapse and then to visible, but this works only in IE8 and Firefox. In other browsers the element still keeps occupying the space, although it is hidden. I want the control to release the space as well when it is hidden.
Thanks & regards,
Nadeem Ullah
I found that setting "visibility=hidden|show" of a containing element (eg a div) allowed hiding|showing the contained object element without it reloading when re-shown. Using the "offsets" method also works (absolutely positioning it out of the visible area of the document).
I have created a web page using cakephp. Now I feel like my boring map on the main page is killing it. I bought imapbuilder which lets you do flash effects on images, however I don't seem to be able to get the code working.
Here is the code I pasted in my home page, but it won't load. All I see is a blank square.
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0"
width="800" height="747" align="middle">
<param name="allowScriptAccess" value="always" />
<param name="movie" value="imapbuilder/loader.swf" />
<param name="base" value="imapbuilder/" />
<param name="flashvars" value="datasource=urlife_map.xml" />
<param name="loop" value="false" />
<param name="menu" value="true" />
<param name="quality" value="best" />
<param name="wmode" value="transparent" />
<param name="bgcolor" value="#ffffff" />
<embed src="imapbuilder/loader.swf" base="imapbuilder/" flashvars="datasource=urlife_map.xml" loop="false" menu="true" quality="best" wmode="transparent" bgcolor="#ffffff" width="800" height="747" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
</object>
This same code I pasted into a separate file and it worked. I kept the folder imapbuilder on the same directory as the home page file.
Does anyone have an idea why this won't load and work on my website?
Files can only be accessed if they are located inside the webroot directory of your app using a standard CakePHP setup.
I suggest you move the imapbuilder folder to the webroot folder and also append all references to it with a / (e.g. /imapbuilder/loader.swf instead of just imapbuilder/loader.swf).
I think an easier solution for you is to use iMapBuilder.net -- which is the online version of iMapbuilder. The map will then be remotely hosted on their server, and all you need to do is copy and paste their code so that no file copying / directory issues.
I have used imapbuilder.net on few CMS based sites, e.g. dotnetnuke and wordpress. And the online based map solution is a lot easier than their Windows version, at least for CMS based sites.
The control that I have built is of size 30x30. however, when the control is rendered, it takes up most of the space on the browser? Why is that so?
Any way to reduce the size to what is desired?
Thanks!
Look at your object tag's width and height attributes.
<object width="300" height="300"
data="data:application/x-silverlight-2,"
type="application/x-silverlight-2" >
<param name="source" value="..."/>
</object>