AIR-AS3 4K screen wrong size detected - actionscript-3

i'm developping a fullscreen app for a multitouch 4K screen
unfornunately the detected screen size is wrong
all these function return 3072x1728 instead of native resolution 3840x2160
trace("screenres : " + Capabilities.screenResolutionX + "x" + Capabilities.screenResolutionY);
trace("mainbounds : " + Screen.mainScreen.bounds.width + "x" + Screen.mainScreen.bounds.height);
trace("mainvisible : " + Screen.mainScreen.visibleBounds.width + "x" + Screen.mainScreen.visibleBounds.height);
trace("stagesize : " + _stage.stageWidth + "x" + _stage.stageHeight);
trace("windowsize : " + _stage.nativeWindow.width + "x" + _stage.nativeWindow.height);
trace("fullsize : " + _stage.fullScreenWidth + "x" + _stage.fullScreenHeight);
i searched for an hour on google, adobe forums and more but can't find any clue why it does this.
does anyone know why ?

Have you tried the latest AIR sdk or latest flash player?
If so, add a bug in the adobe bugbase. Capabilities.screenres should definitely return the correct value
What device are you testing on?
There are ANEs for AIR mobile you can use for now to pull the correct resolution information

Related

SSRS Hyperlink dual parameters errors

I am trying to pass a hyperlink in SSRS to open a new SSRS report (in pdf) from a text box. It is currently set up and works passing a single parameter :
="http://servername/ReportServer_REPORTS16/Pages/ReportViewer.aspx?%2fdummy%2fDocuments%2fCertificate+of+Insurance+Issued&rs:Command=Render&PolicyNo="
& Parameters!PolicyNo.Value &"&rs:Format=PDF"
However when I add in the second parameter :
="http://servername/ReportServer_REPORTS16/Pages/ReportViewer.aspx?%2fdummy%2fDocuments%2fCertificate+of+Insurance+Issued&rs:Command=Render&PolicyNo="
& Parameters!PolicyNo.Value &"&
Entitled="&Parameters!Entitled.Value &"&rs:Format=PDF"
I get an error message :
The ActionInfo.Action.Hyperlink expression for the text box
‘Textbox48’ contains an error: [BC30277] Type character '&' does not
match declared data type 'Object'.
I've gone through every similar error I've found on google but cant work out where im going wrong.
You need to convert all your values to strings then use the + operator....
Here'a an exmaple from one of my reports that does the same thing.
=IIF(Fields!PackSizeDesc.Value = Nothing, Nothing,
"http://MyServername/ReportServer?/Brand+Value/_sub+SKU+Price+Details"
+ "&CountryID=" + cStr(Fields!CountryID.Value)
+ "&CategoryID=" + cStr(Fields!CategoryID.Value)
+ "&RecordedPeriodID=" + cStr(Parameters!PeriodID.Value)
+ "&TMB=" + cStr(Fields!TrademarkBrandID.Value)
+ "&PriceStage=" + cStr(IIF(Fields!IsActualprice.Value = 1, 10, 11))
+ "&pm=" + cStr(Fields!PackMaterialID.Value)
+ "&pt=" + cStr(Fields!PackTypeID.Value)
+ "&ps=" + cStr(Fields!PackSizeID.Value)
+ "&psu=" + cStr(Fields!PackSizeUnitID.Value)
+ "&upp=" + cStr(Fields!UnitsPerPack.Value)
+ "&rc:Parameters=Collapsed")
Note: The first line just disables the link if there is now value in a particular column. This does not render to PDF but that's not part of your issue.

Improving site performance with many images

I am currently making a game in HTML/JS that includes approximately 1200 blocks per level. All of the blocks are individual images, but they are a lot of the time similar. They are 20*20 pixels. After inserting the pictures instead of placeholder divs, the perfomance has gone down a lot.
I am not sure, if it is because of the bandwith, but I would expect the pc to cache the images and reuse it.
Or maybe it is a memory problem with the amount of images.
socket.on("sendBlocks",function(blocks,blocksCoords){
if(typeof blocksCoords[area.X + "_" + area.Y] !== "undefined"){
mapLimit.artX = 0;
mapLimit.artY = -1;
while(mapLimit.X + mapLimit.Y != mapLimit.artX + mapLimit.artY){
mapLimit.artY = mapLimit.artY + 1;
if(mapLimit.artY > mapLimit.Y){
mapLimit.artX = mapLimit.artX + 1;
mapLimit.artY = 0;
}
//Change block, executed for every art-coord.
if(typeof blocksCoords[area.X + "_" + area.Y][mapLimit.artX + "_" + mapLimit.artY] !== "undefined"){
switch(blocksCoords[area.X + "_" + area.Y][mapLimit.artX + "_" + mapLimit.artY].type){
case "wood":
$("#" + mapLimit.artX.toString() + "_" + mapLimit.artY.toString()).attr("src","https://db.tt/TyZBx7EG");
break;
case "empty":
$("#" + mapLimit.artX.toString() + "_" + mapLimit.artY.toString()).attr("src","https://db.tt/SdXqMMiE");
break;
}
}else if(typeof blocksCoords[area.X + "_" + area.Y][mapLimit.artX + "_" + mapLimit.artY] === "undefined"){
$("#" + mapLimit.artX.toString() + "_" + mapLimit.artY.toString()).attr("src","https://db.tt/SdXqMMiE");
}
}
}else if(typeof blocksCoords[area.X + "_" + area.Y] === "undefined"){
$(".block").css("background-color","white");
}
This code will be executed every time that the blocks are updated from the server. Checking if the block is wood, empty or undefined. Giving it different textures for each type of block.
The server updates the blocks every 100 ms, is that too fast?
Any suggestions to how this problem can be solved?
Thanks a lot :)
A browser allows a maximum of 6-8 connection to a domain. So say you have 1200 images, it can only download 8 images at a time. This is something I learned recently. The solution to this was to create subdomains like images.website.com. That way the browser will treat the domain as if its a different one and allow you more 6-8 connections. So now 8 connections for website.com and 8 connection for images.website.come. That gives you 16 connections. Its upto you how many subdomains you'd like to make.

How to send a tile push notification for WP8 from Azure notification hub and C# application?

I am trying to send a tile notification to my WP8 app using a C# Winforms app that has Azure service bus functionality. I have set up the app with the channels needed and have successfully been able to send toast notifications to the app. However, tile notifications have proven to be more difficult. I have been attempting to send them the same way using XML but I am unsure why it is not working on my app. I have the app using channel.BindToShellTile(); along with the other channel logic but I do not think the problem is there as I am able to receive toasts along that same channel. I am currently trying to send this:
string tile = "<?xml version=\"1.0\"?>" +
"<wp:Notification xmlns:wp=\"WPNotification\" Version=\"2.0\">" +
"<wp:Tile Template=\"FlipTile\">" +
"<wp:BackgroundImage Action=\"Clear\">" + "red.png" + "</wp:BackgroundImage>" +
"<wp:Count Action=\"Clear\">" + "1" + "</wp:Count>" +
"<wp:Title Action=\"Clear\">" + "SENDPUSH" + "</wp:Title>" +
"<wp:BackBackgroundImage Action=\"Clear\">" + "blue.png" + "</wp:BackBackgroundImage>" +
"<wp:BackTitle Action=\"Clear\">" + "BackTitle" + "</wp:BackTitle>" +
"<wp:BackContent Action=\"Clear\">" + "Welcome Back!" + "</wp:BackContent>" +
"</wp:Tile>" +
"</wp:Notification>";
and send it by using:
hub.SendMpnsNativeNotificationAsync(tile);
Any help or guidance would be appreciated. Thanks.
I've located the problem. My xml was obviously in error, though I am not sure exactly what the cause of the problem was. Here is working XML if anyone is struggling.
string tile = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<wp:Notification xmlns:wp=\"WPNotification\">" +
"<wp:Tile>" +
"<wp:BackgroundImage>" + backgroundImage + "</wp:BackgroundImage>" +
"<wp:Count>" + count + "</wp:Count>" +
"<wp:Title>" + Title + "</wp:Title>" +
"<wp:BackBackgroundImage>" + backBackgroundImg + "</wp:BackBackgroundImage>" +
"<wp:BackTitle>" + backTitle + "</wp:BackTitle>" +
"<wp:BackContent>" + backContent + "</wp:BackContent>" +
"</wp:Tile> " +
"</wp:Notification>";
hub.SendMpnsNativeNotificationAsync(tile);

how to fill with page with json.data with better looking code?

until now, this is kind of how i fill my page with data i received from $.getJSON.
collection.push("div class='item'><img src='" + items[i].imgurl + "' /><h1>" + items[i].itemname + "</h1><p id='desription" + i + "'>" + items[i].infotxt + "</p></div>);
those lines look so terrible inside my editor, that i wonder if this is even the right way to do it...
might there something like a class costructor for this or anything like that?
thank you very much
Have you looked into the jquery-json plugin?
https://code.google.com/p/jquery-json/

Basic boolean minimization

I am trying to simplify the following piece of boolean algebra so I can construct the circuit :
A'.B'.C.D + A'.B.C.D' + A'.B.C.D + A.B'.C'.D + A.B'.C.D + A.B.C'.D + A.B.C.D' + A.B.C.D
So far I have gotten it to :
(C.D) + (B.C) + (A.C'.D)
Is this correct?
I want to get the best possible minimization.
The steps I have went through so far are :
A'.B'.C.D + A'.B.C.D' + A'.B.C.D + A+B'+C'+D + A.B'+C+D + A.B.C'.D + A.B.C.D' + A.B.C.D
= A.A'(B'.C.D) + A.A'(B.C.D') + A.A'(B.C.D) + B.B'(A.C'.D)
= (B.C.D) + (B'.C.D) + (B.C.D) + (B.C.D') + (A.C'.D)
= (C.D) + (B.C) + (A.C'.D)
Can I do any more?
Assuming your equation is actually:
X = (A'.B'.C.D) + (A'.B.C.D') + (A'.B.C.D) + (A+B'+C'+D) + (A.B'+C+D) + (A.B.C'.D) + (A.B.C.D') + (A.B.C.D);
I just ran this through Logic Friday and it factored it down to:
X = 1;
So you might want to check your simplification work and/or check that you've given the correct equation.
However I suspect there may be typos in the original equation above, and perhaps it should be:
X = (A'.B'.C.D) + (A'.B.C.D') + (A'.B.C.D) + (A.B'.C'.D) + (A.B'.C.D) + (A.B.C'.D) + (A.B.C.D') + (A.B.C.D);
?
In which case Logic Friday simplifies it to:
X = B.C + A.D + C.D;
The only thing I can see that you could possibly do is distribute the "C" in the left two terms:
(C).(B+D)+(A.C'.D)
Or you could distribute the "D":
(C+A.C').D + (B.C)
Response to Comment: The distributive law is described here: http://www.ee.surrey.ac.uk/Projects/Labview/boolalgebra/. See the information under heading "T3"
Here's another solution (found by brute force):
(a+c).(b+d).(c+d)
for simplifying boolean expressions use karnaugh maps. i think it is very much useful if we less number of variables. but if we have more variables then we can follow methods because this method is not that preferable.