ASP.NET Menu Problem With .swf file [duplicate] - asp.net-2.0

This question already has an answer here:
Closed 11 years ago.
Possible Duplicate:
ASP.NET Menu Problem With .swf file
I have a problem in ASP.NET Menu with Flash file.
i have added a .swf file into my asp.net webpage, when ever i view the menu it goes behind the .swf file.Could you plz tell me how to solve this problem...
thanks in advance...

It depends on how your flash object is put onto the page (post your code if you haven't resolved it) but usually you can fix this problem by setting the wmode parameter to transparent. Here is a link to the object/embed tag information from Adobe.
Add the following to your object tags:
<param name="wmode" value="transparent">
If you use something like swfobject to load your flash, you can set the wmode value in the javascript that loads the swf. Here's a rough example using there documentation:
var flashvars = {};
var params = {
wmode: "transparent"
};
var attributes = {};
swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0","expressInstall.swf", flashvars, params, attributes);

Related

Can not display base64 encoded images in an HTML fragment in WinJS app

I'm writing a WinJS app that takes an HTML fragment the user has copied to the clipboard, replaces their
Later, when I go to display the .html, I create an iFrame element (using jQuery $(''), and attempt to source the .html into it, and get the following error
0x800c001c - JavaScript runtime error: Unable to add dynamic content. A script attempted to inject dynamic content, or elements previously modified dynamically, that might be unsafe. For example, using the innerHTML property to add script or malformed HTML will generate this exception. Use the toStaticHTML method to filter dynamic content, or explicitly create elements and attributes with a method such as createElement. For more information, see http://go.microsoft.com/fwlink/?LinkID=247104.
I don't get the exception if I don't base64 encoded the images, i.e. leave them intact and can display iframes on the page with the page showing images.
If I take the html after subbing the urls for base64 and run it through toStaticHTML, it removes the src= attribute completely from the tags.
I know the .html with the encoded pngs is right b/c I can open it in Chrome and it displays fine.
My question is I'm trying to figure out why it strips the src= attributes from the tags and how to fix it, for instance, creating the iframe without using jquery and some MS voodoo, or a different technique to sanitize the HTML?
So, a solution I discovered (not 100% convinced it the best and am still looking for something a little less M$ specific) is the MS Webview
http://msdn.microsoft.com/en-us/library/windows/apps/bg182879.aspx#WebView
I use some code like below (where content is the html string with base64 encoded images)
var loadHtmlSuccess = function (content) {
var webview = document.createElement("x-ms-webview");
webview.navigateToString(content);
assetItem.append(webview);
}
I believe you want to use execUnsafeLocalFunction. For example:
var target = document.getElementById('targetDIV');
MSApp.execUnsafeLocalFunction(function () {
target.innerHTML = content}
);

Windows 8 ListView Control not showing up when placed inside a CSS Grid

I am following along the Microsoft tutorial "Quickstart: Adding a ListView" (Can't post link because of spam prevention) for Windows 8 app development and I am attempting to simply show the raw data from my array in ListView format. I have slightly modified the tutorial so that I am using CSS Grids to structure the page (as Microsoft recommends, I believe). The problem I am having is that when the ListView is situated outside of a Grid, it show's and display's perfectly, but, when located inside a CSS Grid, will not show up on my app. I have very limited knowledge in both CSS Grids and the new Windows 8 platforms so I am sure it is a simple mistake that I have made. Below is my CSS and HTML code, all the Javascript should be identical to that used in the Microsoft tutorial...
http://pastebin.com/cgV5PHnf - HTML
http://pastebin.com/HvVPuhkG - CSS
With your HTML and CSS, verbatim, data is showing fine for me. This is my tempData.js:
(function () {
"use strict";
var items = new WinJS.Binding.List();
items.push({ value1: "foo", value2: "bar" });
items.push({ value1: "foo2", value2: "bar2" });
WinJS.Namespace.define("TempData", {
itemList: items.dataSource
});
})();
Note, I included dataSource in the definition of itemList, since your data-win-options did NOT include it (the Quickstart pulls that into the attribute). Without it though you'd be getting a pretty noticeable exception, so suspect you're doing the same in your TempData definition.
One thing you could try is DOM Explorer in Visual Studio or open the application in Blend and use Interactive Mode to see if there is some sort of unexpected CSS class overriding.

How to run one application from another application in flex?

I have two flex applications Main.mxml(where I have a button called loadDataViewer) and ViewData.mxml. What I want is when the user press the loadDataViewer button, the application ViewData.mxml will open in a new window. Is there any way to do it in Flex?
SWFLoader class looks interesting but I think it will load the other appliation inside the Main application which I don't want. I also saw that there is ExternalInterfaceAPI which can be used to open a url browser but not sure if I can reference the swf file of VewData application. As suggested here( http://learn.adobe.com/wiki/display/Flex/Local+Connections ) that LocalCOnnection can be used to reference one flex application in another but that's only when both applications are open I guess.
Any suggestion to guide me to the right direction wouild be greatly appreciated.
You could embed your viewData swf to an HTML file, and either do any of the following:
Call External Interface...
var url:String = 'myViewData.html';
ExternalInterface.call('window.open("' + url + '")');
or
Call the navigateToURL method...
var url:String = 'myViewData.html';
var urlReq = new URLRequest(url);
navigateToURL(urlReq,'_blank');
Use Modules. Adobe help.

How to display an image in flex with Content-Type: image/jpeg?

I have an .aspx page that generates thumbnails. It takes an ID and returns an image with response Content-Type: image/jpeg.
How do I display this image in Flex?
I believe this should work:
<mx:Image source="http://localhost/webform.aspx?ID=1"/>
You can obviously set the source in ActionScript or make the URL a bindable string so that you can pass in the ID.
Generally you use the Image tag, and provided you're setting the response headers and encoding the bytes properly on the server (and you're working within the security sandbox), you should just be able to set the source property of that tag (it need not be #Embed-ded), and be done:
<mx:Image source="http://someurl.com/myimagegenerator.php?id=123" />
Are you having a problem with that approach, or is it just a general-information question?
Take a look a Loader
var loader:Loader = new Loader();
loader.load(new URLRequest("http://www.yoursite.com/yourasp.aspx?img=01001"));
addChild(loader);

Flex: Passing MXML file as XML Parameter

Is it Possible to pass MXML it self as parameter(XML param) from external application and load in Flash Player dynamically to create page. For e.g
passing xml = <mx:canvas><mx:label text="hello" /></mx:canvas> to Flex and flex should create canvas with label control in it. Is there any example related to it.
Thanx
MXML code needs to be compiled down to ActionScript before Flash Player can do anything with it. MXML is not interpreted by Flash Player at runtime.
What you are wanting to do is not possible. Like brd6644 said, mxml is compiled down to bytecode in the swf which is interpreted by the flash player. The mxml (and even actionscript) is not understood by the flash player.
That being said, there is a JSP library that you can use for dynamic MXML. See here:
http://www.adobe.com/devnet/flex/articles/server_perf_05.html
That link is old, and right now I can't seem to find an updated link, but I know the project still exists. I believe it actually ships as part of ColdFusion still. It allows you to create dynamic mxml which gets JIT compiled at the request. It of course has a substantial performance hit because of it, but if you need dynamic MXML it is an option.
I will update this comment with a better link when I find it.
Just store the properties of the
component to a XML and put a className
attribute so that if you load the XML
you can have a function to set the
attributes of the XML to the
properties of your created component
which will be determined in your
className attribute
My initial guess is no, it would still be of type "XML", and there is no "eval" in Actionscript 3. I did a quick search and am going to have to say no, this is not possible.
I have however, done something similar in an app I created.
What I did was store in a database the object type, and some properties (x,y,width,height, etc). This data is returned from a remote object call and these objects are then created at runtime, which can get a similar effect you are trying to achieve.
For example:
var resultAC:ArrayCollection = event.result as ArrayCollection;
var tmpCanvas:Canvas;
for(var i:int = 0; i < resultAC.length; i++)
{
if(resultAC.getItemAt(i).type == "Canvas")
{
tmpCanvas = new Canvas();
tmpCanvas.x = resultAC.getItemAt(i).x;
tmpCanvas.y = resultAC.getItemAt(i).y;
...
parent.addChild(tmpCanvas);
}
}

Resources