共享对象位置 [英] sharedObject location

查看:298
本文介绍了共享对象位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用这种方法保存在特定位置的共享对象,但我不能给路径

  SharedObject.getLocal的(拯救,如何给路径这里窗);
 

这给下面的错误

 错误:错误#2130:无法刷新共享对象。
在错误$ / throwError()
在flash.net::SharedObject/flush()
在OnlineDiagramEditor / SaveData_mouseDownHandler()[C:\ Users \用户ruchidod \的Adobe Flash Builder的4.6 \ OnlineDiagramEditor的\ src \ OnlineDiagramEditor.mxml:3240]
在OnlineDiagramEditor / __ SaveData_mouseDown()[C:\ Users \用户ruchidod \的Adobe Flash Builder的4.6 \ OnlineDiagramEditor的\ src \ OnlineDiagramEditor.mxml:3522]
在flash.events::EventDispatcher/dispatchEventFunction()
在flash.events::EventDispatcher/dispatchEvent()
在mx.core::UIComponent/dispatchEvent()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:13152]
在mx.managers::SystemManager/mouseEventHandler()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\SystemManager.as:2918]
 

有些时候它给

 错误:错误#2134:无法创建共享对象。
在flash.net::SharedObject$/getLocal()
在OnlineDiagramEditor / SaveData_mouseDownHandler()[C:\ Users \用户ruchidod \的Adobe Flash Builder的4.6 \ OnlineDiagramEditor的\ src \ OnlineDiagramEditor.mxml:3236]
在OnlineDiagramEditor / __ SaveData_mouseDown()[C:\ Users \用户ruchidod \的Adobe Flash Builder的4.6 \ OnlineDiagramEditor的\ src \ OnlineDiagramEditor.mxml:3522]
在flash.events::EventDispatcher/dispatchEventFunction()
在flash.events::EventDispatcher/dispatchEvent()
在mx.core::UIComponent/dispatchEvent()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:13152]
在mx.managers::SystemManager/mouseEventHandler()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\SystemManager.as:2918]
 

解决方案

共享对象会自动保存在predefined位置,他们不跨域,这意味着每个域只能读取自己的左右。

的localPath 仅仅是定义了predefined位置Flash播放器的其中的子文件夹中要保存SO的参数。这是,默认情况下,简称SWF即节约了SO本身。

  

的localPath:String [可选] - 一个字符串,指定的完整或部分路径,创建共享对象的SWF文件,并​​确定共享对象存储在本地。默认值是完整路径。

另外:

  

虽然的localPath 参数是可选的,你应该考虑一下它的使用,特别是如果其它SWF文件需要访问共享对象。如果共享对象中的数据特定于一个不会移动到其它位置的SWF文件,则使用默认值是有道理的。如果其它SWF文件需要访问共享对象,或如果创建共享对象的SWF文件以后将被移动,则此参数的值会影响任何SWF文件是否能够访问共享对象。例如,如果你创建了localPath设置为完整路径SWF文件的默认值的共享对象,那么其它任何SWF文件都可以访问该共享对象。如果您以后将原始的SWF文件移动到另一个位置,则即使该SWF文件将无法访问已经存储在共享对象中的数据。

所以,如果你已经多个SWF的在同一个域的这就需要因此获得同样的,你需要给一个路径中的getLocal(),相同的每个SWF。

HTTP://help.adobe。 COM / EN_US / AS2LCR / Flash_10.0 / help.html?内容= 00001508.html


例如:

在Windows中,所以都存储在%APPDATA%\ Macromedia的\ Flash播放器\ #SharedObjects \

下面是为您的用户的子文件夹,如 5D3RT21F

然后,我们对发起该域的子文件夹的SO文件,如 www.flickr.com

然后几个子文件夹,以反映该领域,如 \ APPS \幻灯片\ show.swf \ 的SWF的相对路径,你可以找到所以这里文件

但是,如果您指定 / 的)作为的localPath 那么你会找到如此直接的 www.flickr.com 文件和其它SWF在同一个域将自由访问它。

i'm using this method to save shared object in specific location but i'm not able to give path

SharedObject.getLocal("save","how to give path here for window");

and this gives following error

Error: Error #2130: Unable to flush SharedObject.
at Error$/throwError()
at flash.net::SharedObject/flush()
at OnlineDiagramEditor/SaveData_mouseDownHandler()[C:\Users\ruchidod\Adobe Flash Builder 4.6\OnlineDiagramEditor\src\OnlineDiagramEditor.mxml:3240]
at OnlineDiagramEditor/__SaveData_mouseDown()[C:\Users\ruchidod\Adobe Flash Builder 4.6\OnlineDiagramEditor\src\OnlineDiagramEditor.mxml:3522]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:13152]
at mx.managers::SystemManager/mouseEventHandler()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\SystemManager.as:2918]

some times it gives

Error: Error #2134: Cannot create SharedObject.
at flash.net::SharedObject$/getLocal()
at OnlineDiagramEditor/SaveData_mouseDownHandler()[C:\Users\ruchidod\Adobe Flash Builder 4.6\OnlineDiagramEditor\src\OnlineDiagramEditor.mxml:3236]
at OnlineDiagramEditor/__SaveData_mouseDown()[C:\Users\ruchidod\Adobe Flash Builder 4.6\OnlineDiagramEditor\src\OnlineDiagramEditor.mxml:3522]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:13152]
at mx.managers::SystemManager/mouseEventHandler()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\SystemManager.as:2918]

解决方案

SharedObjects are automatically saved in a predefined location and they aren't cross-domain, that means that each domain can read only its own SO.

The localPath is only a parameter that defines in which subfolder of the predefined location Flash player should save the SO. This is, by default, referred to the SWF that is saving the SO itself.

localPath: String [optional]- A string that specifies the full or partial path to the SWF file that created the shared object, and that determines where the shared object is stored locally. The default value is the full path.

Also:

Although the localPath parameter is optional, you should give some thought to its use, especially if other SWF files need to access the shared object. If the data in the shared object is specific to one SWF file that will not be moved to another location, then use of the default value makes sense. If other SWF files need access to the shared object, or if the SWF file that creates the shared object will later be moved, then the value of this parameter affects whether any SWF files are able to access the shared object. For example, if you create a shared object with localPath set to the default value of the full path to the SWF file, then no other SWF file can access that shared object. If you later move the original SWF file to another location, then not even that SWF file can access the data already stored in the shared object.

So if you've multiple SWF on the same domain which need to access the same SO, you need to give a path to getLocal(), the same for each SWF.

http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=00001508.html


For example:

In Windows, SO are stored in %APPDATA%\Macromedia\Flash Player\#SharedObjects\.

Here is a subfolder for your user, like 5D3RT21F.

Then we have a subfolder for the domain that originated the SO file, like www.flickr.com.

Then several subfolders to reflect the relative path of the SWF on the domain, like \apps\slideshow\show.swf\, you can find the SO file in here.

But if you specify / (root) as localPath then you'll find the SO file directly in www.flickr.com and other SWF on the same domain will access it freely.

这篇关于共享对象位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆