AS3 Crossdomain imageload - actionscript-3

Actually i have to load images into stage from any server,
so tried using crossdomain.xml from my server root.
though it throughs error
SecurityError: Error #2122: Security sandbox violation:
Loader.content: http://sss/Player.swf cannot access
http://ffff/images/logo-bg.jpg. A policy file is required, but the
checkPolicyFile flag was not set when this media was loaded. at
flash.display::Loader/get content() at
SS4UPlayer_fla::MainTimeline/ss4uLogoCompleteHandler()
Whats the problem, Please can you find it.

import flash.system.LoaderContext;
Using this LoaderContext i just got clear my problem and loaded config.xml under my root directory.

Related

AS3 AIR loading online mp3 - Error #2044: Unhandled IOErrorEvent:

UPDATE: Any version of AIR is blocking any external content. This simple pic script won't work either.
var my_loader:Loader = new Loader();
my_loader.load(new URLRequest("http://edvizenor.com/images/Ed-Vizenor.png"));
addChild(my_loader);
BUT HOW DO I FIX THIS?
UPDATE: More error info:
Attempting to launch and connect to Player using URL C:\Flash Apps 2014\Real Projects\Fr Letherby\Homily.swf
[SWF] C:\Flash Apps 2014\Real Projects\Fr Letherby\Homily.swf - 981 bytes after decompression
*** Security Sandbox Violation ***
Connection to http://traffic.libsyn.com/frleatherby/2015Jul18.mp3 halted - not permitted from file:///C|/Flash%20Apps%202014/Real%20Projects/Fr%20Letherby/Homily.swf
-- Untrusted local SWFs may not contact the Internet.
SecurityError: Error #2028: Local-with-filesystem SWF file file:///C|/Flash%20Apps%202014/Real%20Projects/Fr%20Letherby/Homily.swf cannot access Internet URL http://traffic.libsyn.com/frleatherby/2015Jul18.mp3.
at flash.media::Sound/_load()
at flash.media::Sound/load()
at Homily_fla::MainTimeline/frame1()[Homily_fla.MainTimeline::frame1:2]
Cannot display source code at this location.
BELOW IS THE ORIGINAL POST.
I just got a new comp using windows 8 and installed creative cloud. I am using the Flash IDE and I am trying to load a sound from online. It's a simple script but I am getting this error below.
NOTE: I am using Air 17.0 for Android. It's not working. However, when I load this same script in the flash player it works.
As you can see it's a valid live link: http://traffic.libsyn.com/frleatherby/2015Jul18.mp3
But it won't play. Did abode block this streaming feature? What simple line am I missing. This was so easy before. Is it a setting on my new computer? Thanks for any tips.
package {
import flash.display.MovieClip;
import flash.events.Event;
import flash.media.Sound;
import flash.net.URLRequest;
public class Main extends MovieClip {
public function Main() {
// constructor code
var mySound:Sound = new Sound();
mySound.load(new URLRequest("http://traffic.libsyn.com/frleatherby/2015Jul18.mp3"));
mySound.play();
}
}
}
THE ERROR
Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error.
at Main()[C:\Flash Apps 2014\Real Projects\Fr Letherby\Main.as:13]
at runtime::ContentPlayer/loadInitialContent()
at runtime::ContentPlayer/playRawContent()
at runtime::ContentPlayer/playContent()
at runtime::AppRunner/run()
at ADLAppEntry/run()
at global/runtime::ADLEntry()
[UnloadSWF] Homily.swf
Test Movie terminated.
From your updates, this seems to be a security violation, and you will need to provide AIR the necessary permissions to be able to do this. Try this at the start of your application:
Security.allowDomain("Your Domain URL here");
And, In Flash IDE by going to File->Publish Settings->Flash->Local playback security and choosing either ‘Access local files only’ or ‘Access network only’.
If your application is web-based and is accessing a web-service of some kind on a different domain to the one the .swf file is hosted on you can get a sandbox violation if the domain you are accessing does not have a valid cross domain policy in place. You would also need to place a crossdomain.xml file at the root of your server which you are trying to access. It looks like this:
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*" />
<site-control permitted-cross-domain-policies="master-only"/>
</cross-domain-policy>
Hope this helps.

Php and Smarty3 - filemtime() [function.filemtime]: stat failed for

I'm migrating my WebAPP from Smarty2 to Smarty3. Every step is easy except one. When i display a Smarty Template ( tpl ) an Exception is thrown.
This line
Source: /path_to_file/smarty/libs/sysplugins/smarty_resource.php (773)
(this is the source coude $compiled->timestamp = #filemtime($compiled->filepath); )
raise this Exception when the file doesn't exists
filemtime() [function.filemtime]: stat failed for /path_to_templates/smarty/templates_c/219dfe732aae7bd7c0edab091e3c53f3ce86b058.file.index.tpl.php
Folder permissions:
Smarty template folder Permission : 775
Smarty Cache folder permission: 775
Folder Owners:
both ftp_user:webserver_user
I'm trying to implement different solutions but it seems not possibile to solve this issue whitout changhing Php Error Reporting or disabling my Error Handler .
How can i solve this problem without hacks ?
What you should do is not to downgrade to 3.1.1 but rather try to upgrade to 3.1.19 version. Many bugs are removed all the time so maybe in this version you won't have it.
The other thing is that you can use muteExpectedErrors method to hide file system warnings from Smarty (documentation for this function is not very clear but it affects file system warnings what is explained in error_reporting documentation). You can read at error_reporting documentation page:
Smarty 3.1.2 introduced the muteExpectedErrors() function. Calling
Smarty::muteExpectedErrors(); after setting up custom error handling
will ensure that warnings and notices (deliberately) produced by
Smarty will not be passed to other custom error handlers. If your
error logs are filling up with warnings regarding filemtime() or
unlink() calls, please enable Smarty's error muting.
Check the filesystem permission on /path_to_templates/smarty/templates_c/219dfe732aae7bd7c0edab091e3c53f3ce86b058.file.index.tpl.php
PHP does not seam to have read/write permission on that file.
Also check the permission in the /path_to_templates/smarty/templates_c/ folder. Is the PHP allowed to read list and write in there as well?

Blog Engine as a virtual directory and Umbraco application as parent application is causing the below error

Parent application built using Umbraco 4.9.0.
Child application built using Blog Engine 2.8.
Am hosting this on IIS6, and am loading the website, my parent application is loading good but my blog is not loading and it is throwing the below error.
Server error in '\blog' Application.
Runtime error
I couldn't view the description of the error even after i make the customerror to "RemoteOnly"
But below is the error from Event Viewer.
Exception information:
Exception type: HttpException
Exception message: Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
AM very sure the parent application is inheriting and causing the above error, but i could fix it :( please help!
Your help is very much appreciated by this lone fighter.
Please refer the following link for the answer of this question:
Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, or one of its dependencies
One thing you will need to do is to tell Umbraco to ignore the /blog url. That way it won't try to process that route.
NOTE:
To do that find the "umbracoReservedPaths" key in the appSettings (in the web.config file). In the value add ",~/blog" to the end of the other paths.
Also, remember that virtual directories inherit the web.config settings from the website they are in. So you may need to add some 's to the web.config for BlogEngine to remove Umbraco things that it cannot or will not use.
Are they both running the same version of .net?

Insert a video on Action Script 3.0

Hi I'm trying to put a FLV video into a flash adobe CC actionscript project and it gives me an error like this one when I try to get to the corresponding photogram:
Error #2044: Unhandled skinError:. text=[SecurityErrorEvent
type="securityError" bubbles=false cancelable=false eventPhase=2
text="Error #2140: Security sandbox violation:
file:///C|/Users/Gael/Desktop/pfc/proxecto.swf cannot load
file:///C|/Users/Gael/Desktop/pfc/SkinOverAllNoVolNoCaptionNoFull.swf.
Local-with-filesystem and local-with-networking SWF files cannot load
each other."]
Can someone tell me how to fix this?
This problem is not caused by flv video. It is caused by the player skin SkinOverAllNoVolNoCaptionNoFull.swf compiled with security sandbox type other than security sandbox type of your application.
You need to change Security sandbox type of your proxecto.swf application.
You can configure a SWF file for the local-with-networking sandbox by setting the document’s publish settings in the authoring tool.

System.Security.SecurityException being thrown on initializing StructureMap bootstrapper

I am running a .NET 4.0 web application locally using the Visual Studio Development Server (built in web server with VS2010), and for the last couple months, my StructureMap bootstrapper file has worked perfectly.
I'm using StructureMap 2.6.1
I have not changed the Bootstrapper file or the Web.config file, and suddenly, I'm getting this strange error when trying to start up my web application.
Here is the error being thrown from the website:
it's a bit tough to read. It says:
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException. Request Failed.
here is the code in my bootstrapper file:
public class BootStrapper
{
public static void ConfigureStructureMap()
{
ObjectFactory.Initialize(x =>
{
x.AddRegistry<ProductRegistry>();
});
}
}
public class ProductRegistry : Registry
{
public ProductRegistry()
{
For<IFirmRepository>()
.Use<FirmRepository>().Ctor<string>("connectionString").Is(ConfigurationManager.ConnectionStrings["FeesAndFlows"].ConnectionString);
For<ICryptographyService>()
.Use<Rijndael>();
For<IUserRepository>()
.Use<UserRepository>().Ctor<string>("connectionString").Is(ConfigurationManager.ConnectionStrings["FeesAndFlows"].ConnectionString);
For<IAuthenticationService>()
.Use<AuthenticationService>();
For<ILogger>()
.Use<DatabaseLogger>();
}
}
The error is being thrown on this line:
x.AddRegistry<ProductRegistry>();
I've already tried adding each of these lines to my Web.config file, one at a time, and they didn't fix the problem:
<trust level="Full" />
and
<securityPolicy>
<trustLevel name="Full" policyFile="internal"/>
</securityPolicy>
Does anyone have any ideas or might have heard of a problem like this? It's pretty important, b/c without StructureMap starting up correctly, my entire application will not run.
Thanks,
Mike
UPDATE:
Ok, so it appears my problem is local. Other developers here can download the code, and runs it just fine on their local machines. Weird. They bootstrap StructurMap just fine and all instances are resolved...
Any ideas on why just my machine can't bootstrap StructureMap when running in debug mode locally for my web project?
Are you running the code from a network drive by any chance (ie is your documents folder redirected onto a network drive)? Are you in an enterprise environment running on a domain?
If the former it's likely that the code is running in the intranet security context. If the former isn't true but the later is, then its quite possible that a network administrator has changed the enterprise wide CAS policy.
Okay, so this was the problem. The StructureMap.dll was blocked by Win 7. I don't know how is become blocked or where it became blocked, but apparently, when I downloaded the StructureMap.zip file onto my system, the .zip file was blocked, which in turn, led to all the items extracted from the .zip file being blocked as well.
Every time I unblocked it, it went back to blocked when I tried to run the web app.
The way I fixed it was to go back to the original .zip file, unblock it, extract it, and then replace my StruectureMap.dll reference with one that was not blocked.
Insane.
I don't even know WHAT causes file to suddenly become blocked or what process in Windows 7 determines what file(s) should be blocked, but this strange operating system "feature" cost me a day's worth of work.
I had the exact same issue at the exact same place, ObjectFactory.Initialize:
Server Error in '/X.ServiceHost' Application.
Inheritance security rules violated while overriding member:
'StructureMap.StructureMapException.GetObjectData(System.Runtime.Serialization.SerializationInfo,
System.Runtime.Serialization.StreamingContext)'. Security
accessibility of the overriding method must match the security
accessibility of the method being overriden.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.TypeLoadException: Inheritance security
rules violated while overriding member:
'StructureMap.StructureMapException.GetObjectData(System.Runtime.Serialization.SerializationInfo,
System.Runtime.Serialization.StreamingContext)'. Security
accessibility of the overriding method must match the security
accessibility of the method being overriden.
Getting the latest StructureMap package from NuGet (2.6.4.1) fixed the issue.
StructureMap NuGet Package