gpt4 book ai didi

actionscript-3 - 共享对象位置

转载 作者:行者123 更新时间:2023-12-04 04:28:29 24 4
gpt4 key购买 nike

我正在使用此方法将共享对象保存在特定位置,但我无法提供路径

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

这给出了以下错误
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]

有时它给
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]

最佳答案

SharedObject 会自动保存在预定义的位置,并且它们不是跨域的,这意味着每个域只能读取自己的 SO。
localPath只是一个参数,用于定义 Flash 播放器应将 SO 保存在预定义位置的子文件夹中。默认情况下,这是指保存 SO 本身的 SWF。

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.



还:

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.



因此,如果您在同一个域上有多个 SWF 需要访问相同的 SO,则需要提供指向 getLocal() 的路径。 ,每个 SWF 都相同。

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

例如:

在 Windows 中,SO 存储在 %APPDATA%\Macromedia\Flash Player\#SharedObjects\ .

这是您用户的子文件夹,例如 5D3RT21F .

然后我们有一个用于创建 SO 文件的域的子文件夹,例如 www.flickr.com .

然后是几个子文件夹来反射(reflect)SWF在域上的相对路径,比如 \apps\slideshow\show.swf\ ,您可以在此处找到 SO 文件。

但是如果你指定 / (根)为 localPath那么你会直接在 www.flickr.com中找到SO文件和同一域上的其他 SWF 文件将可以自由访问它。

关于actionscript-3 - 共享对象位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15084338/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com