Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0

Reply
 
Thread Tools Rate Thread Display Modes
Old 12-05-2008, 01:18 PM   #1
scantron13
Registered User
 
Join Date: Dec 2008
Posts: 2
Cool Cannot Access Text within Cross Domain SWF

Hello Everybody,
I am trying to make a "mother" swf to hold all my functions, shortcuts, etc.. This "mother" swf will be stored on a "mother" server.
I intend to make several websites on different servers that all access this "mother" swf for various tasks.
I created two testing domains (unitcounter.com & projectvolcano.com) where I was able to have cross-domain swfs share functions & variables successfully.
The problem occurs when one swf tries to write to a textfield in another swf. I can change properties like position and rotation, but I cannot access properties such as ".text", which is the most important property I need to use.

Mother SWF: "www.projectvolcano.com/a.swf" (a.swf)
2nd SWF: "www.unitcounter.com/b.swf" (b.swf)

Note: b.swf loads a.swf using loadMovie
Note: Both servers contain crossdomain.xml files allowing any other server full access
Note: Both SWFs contain "allowdomain" statements allowing any other SWF, on any other server, full access

The actionscript I used for both SWFs is below. If b.swf and a.swf where communicating correctly, then b.swf would load a.swf, then b.swf would alter the textfield located in a.swf to read "NICE" instead of "RED HAT". Further, b.swf would then list all the properties of the textfield located in a.swf.
Take a look at b.swf and see for yourself. Thanks in advance for anybody who can help; I've been battling with this problem for 2 weeks now.

Final Note: In b.swf, you must press the black button to manipulate the loaded a.swf



----Complete Code for a.swf (one frame SWF)-----
// ALLOW ALL DOMAINS TO ACCESS THIS SWF
System.security.allowDomain("*");

// SAMPLE TEXT
xxx.text = "RED HAT";




-----Complete Code for b.swf (one frame SWF)------
// ALLOW EVERY DOMAIN TO ACCESS THIS SWF
System.security.allowDomain("*");

// MAKE A MOVIECLIP TO LOAD THE CROSS-DOMAIN SWF INTO
_root.createEmptyMovieClip("nas",_root.getNextHigh estDepth());
_root.nas.loadMovie("http://www.projectvolcano.com/a.swf");

// ONCE THE EXTERNAL SWF IS LOADED, PRESS THIS BUTTON TO ALTER IT
butt.onRelease = function(){

// CHANGE THE TEXT VALUE (DOES NOT WORK)
_level0.nas.xxx.text = "NICE";

// CHANGE THE ROTATION VALUE (WORKS)
_level0.nas.xxx._rotation += 20;

// SHOW ALL THE PROPERTIES OF THE TEXTFIELD IN A.SWF -
// (IN THE LOADED SWF) YOU TRIED TO ACCESS
ppp.html = true;
ppp.htmlText = "";
for(prop in _level0.nas.xxx){
ppp.htmlText += prop+" = "+_level0.nas.xxx[prop] +"<BR>";}}

Last edited by scantron13; 12-05-2008 at 01:21 PM.
scantron13 is offline   Reply With Quote
Old 12-09-2008, 12:21 PM   #2
scantron13
Registered User
 
Join Date: Dec 2008
Posts: 2
Question Update

Update: When using Flash Player Plugin 8, the cross domain SWFs can easily communicate with each other (read/write to each other's textfields). Its only when using Flash Player Plugin 9 (or higher) do the textfields stop being accessible. I covered my bases, using a crossdomain.xml file:

Code:
<?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="*"/>
   </cross-domain-policy>

Also, I am using an allowdomain statement in each SWF:

Code:
System.security.allowDomain("*");


I now understand that even though my SWFs were made in Flash 8, they are still subject to the security features in each new version of the Flash Player Plugin. I just cannot figure out how to fix my Cross Domain SWFs so they can communicate with each other using Flash Player Plugin 9 (and higher).

Does anybody know what changed between Flash Player Plugin 8 and Flash Player Plugin 9 that would prevent Cross Domain SWFs from accessing each other's textfields (reading/writing to textfields)?

Summary of Problem:

Flash Player Plugin 8:
1. Can Access Textfield properties that change appearance (_x, _y, _alpha, _height, etc)
2. Can Access text within Textfields (.text)

Flash Player Plugin 9 (and higher):
1. Can Access Textfield properties that change appearance (_x, _y, _alpha, _height, etc)
2. CANNOT Access text within Textfields (.text)

Thanks for taking a look at this thread. Please comment if you have any suggestions.
scantron13 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Access on a frame the output text from an on-screen keyboard gstam78 ActionScript 2.0 0 11-12-2008 02:58 PM
Cross Domain XML stompwampa ActionScript 3.0 2 08-04-2008 02:01 PM
Can't access stage from external swf chillinum ActionScript 3.0 2 07-29-2008 02:52 PM
Empty text fields in a loaded SWF nektir ActionScript 3.0 5 06-10-2008 10:38 PM
Loading SWF cross domain Huw ActionScript 2.0 0 10-19-2007 11:05 AM


All times are GMT. The time now is 05:11 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.