iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Flash Discussion Forum Flash design presents a limitless number of possibilities for your sites and designs. Discuss your Flash ideas, questions and issues here.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-09-2008, 06:42 AM
WebProWorld New Member
 
Join Date: Dec 2008
Posts: 2
scantron13 RepRank 0
Cool Flash 8: Cannot Access Textfield in Cross Domain SWF

Flash 8 Actionscript

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
Note: a.swf and b.swf both use embedded Verdana font

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 or b.fla 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)-----
Code:
// ALLOW ALL DOMAINS TO ACCESS THIS SWF
System.security.allowDomain("*");

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



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

// MAKE A MOVIECLIP TO LOAD THE CROSS-DOMAIN SWF INTO
_root.createEmptyMovieClip("nas",_root.getNextHighestDepth());
_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>";}}
Reply With Quote
  #2 (permalink)  
Old 12-09-2008, 09:57 AM
WebProWorld New Member
 
Join Date: Dec 2008
Posts: 2
scantron13 RepRank 0
Default 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.
Reply With Quote
Reply

  WebProWorld > Site Design > Flash Discussion Forum

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Internal domain blockig access to external domain imsickofwebpro IT Discussion Forum 1 02-20-2008 04:40 PM
Cross-Domain Shopping Cart ccamarat Search Engine Optimization Forum 5 07-06-2006 06:48 PM
Developing a Cross-platform Flash Game for Dolce & Gabbana WPW_Feedbot Graphics & Design Discussion Forum 0 05-02-2005 03:06 PM
intergrate flash into a access database Astral_Enterprise Flash Discussion Forum 3 12-12-2004 01:48 PM
intergrate flash into a access database Astral_Enterprise Database Discussion Forum 0 12-11-2004 06:27 AM


All times are GMT -4. The time now is 07:07 PM.



Search Engine Optimization by vBSEO 3.3.0