Sunday, March 28, 2010

Flash Site not working properly on...

My website http://www.artectodesignstudios.com (click on the login button - no password or screen name required) works properly on my computer ( Macbook Pro, 4GB RAM, 98.5 GB HD, 2.4 GHz Intel Core 2 Duo Processor) on all the following browsers ( Safari, FireFox, Opera, Camino) and on VMFusion - Windows 7 Beta with browsers ( I.E and Firefox).

I have been told by a few clients that my website ''is not working'' however others tell me my website is working fine. I have asked both the clients that are able and unable to view my flash site what version of Adobe Flash Player they have installed on their machines and all have Adobe Flash Player 10.

Has anyone every encountered a problem like this? If so, how did you go about finding a solution?

Thanks

Flash Site not working properly on...

Are you loading any XML files to the local machine or any PHP files or anything like that. You may need a cross domain policy file.

James.

http://www.toshiedo.com.au

Flash Site not working properly on...

Hi James,

Thank you for your help. I am using XML files to load in my carousel portfolio gallery and about menu. PHP is used to send CGI mailer but that seems to load in without any problems. The main issue is my carousel portfolio gallery is not loading. How would I setup a cross domain policy file?

Thanks,

Jerrell

Hi Jerrell,

check out this tutorial on setting up cross domain policy files. For quick setup use example 2. and upload it to your main ftp directory. That should do the trick.

James

http://www.toshiedo.com.au

Hi James,

there are several examples on how to make a cross domain policy files on http://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html#cross-dom ain-policy. I used this example

%26lt;?xml version=''1.0''?%26gt;
%26lt;!DOCTYPE cross-domain-policy SYSTEM
''http://www.adobe.com/xml/dtds/cross-domain-policy.dtd''%26gt;

%26lt;cross-domain-policy%26gt;
%26lt;allow-access-from domain=''*'' secure=''false''/%26gt;
%26lt;/cross-domain-policy%26gt;


Should this do the trick? How safe is it to use this file?

Thanks,

Jerrell

too safe,

just to be sure add this line for your own domain...

%26lt;allow-access-from domain=''*.example.com''/%26gt;

give it a shot and let me know how you go, it should work.

James.

http://www.toshiedo.com.au

James,

As suggested I added the following xml script (policy.xml) and placed it on my server but my site still seems to be pulling in the xml sluggish. However, once the xml is retrieved the website runs smooth. I'm not receiving an error message when compiling my portfolio .fla however maybe there is something i can do different in my script that will make my xml be retrieved faster?

Here is the XML file (policy.xml)

%26lt;?xml version=''1.0''?%26gt;

%26lt;!DOCTYPE cross-domain-policy SYSTEM

''http://www.adobe.com/xml/dtds/cross-domain-policy.dtd''%26gt;

%26lt;cross-domain-policy%26gt;

%26lt;allow-access-from domain=''*'' secure=''false''/%26gt;

%26lt;allow-access-from domain=''*.artectodesignstudios.com''/%26gt;

%26lt;/cross-domain-policy%26gt;

Here is my portfolio script:

package {

import com.gskinner.motion.GTween;

import com.leebrimelow.utils.Math2;

import com.theflashblog.fp10.SimpleZSorter;

import fl.motion.easing.Exponential;

import flash.display.Loader;

import flash.display.Sprite;

import flash.display.Stage;

import flash.events.Event;

import flash.events.MouseEvent;

import flash.net.URLLoader;

import flash.net.URLRequest;

import flash.net.navigateToURL;

import flash.text.TextField;

public class Carousel extends Sprite {

private var container:Sprite;

private var loader:URLLoader;

private var xmlLoader:URLLoader;

private var anglePer:Number;

private var arrayLister:Number;

public var imc:imCon=new imCon?;

private var dragging=0;

private var xMouse:Number;

private var yMouse:Number;

private var xml:XML;

private var urRequest:URLRequest;

private var theRate:int;

//puts the end-users system on sleep mode when not active

public function listenMouseLeave(evt:Event):void {

stage.addEventListener(Event.MOUSE_LEAVE,leavingMode);

}

public function leavingMode(e:Event):void {

trace(''not active'');

theRate=stage.frameRate;

staticRate();

stage.addEventListener(MouseEvent.MOUSE_MOVE,welcomeBack);

}

// wakes up the end-users system when activated again

public function welcomeBack(e:Event):void {

trace(''I'm back'');

stage.frameRate=theRate;

stage.removeEventListener(MouseEvent.MOUSE_MOVE,welcomeBack);

}

public function Carousel() {

init();

loadXML();

}

private function loadXML():void {

loader=new URLLoader(new URLRequest(''images.xml''));

loader.addEventListener(Event.COMPLETE,createCarousel);

}

private function createCarousel(e:Event):void {

var xml:XML=new XML(e.target.data);

anglePer=Math.PI*2/xml.image.urlimage.length();

for (var i:int=0; i%26lt;xml.image.urlimage.length(); i++) {

var imc:imCon=new imCon?;

imc.name=xml.image.link1[i];

imc.enabled=true;

imc.buttonMode=true;

imc.doubleClickEnabled=true;

imc.mouseChildren=false;

imc.addEventListener(MouseEvent.CLICK,onClick,false,0,true);

imc.addEventListener(MouseEvent.DOUBLE_CLICK,clicker,false,0,true);

imc.addEventListener(MouseEvent.MOUSE_DOWN,DragStart,false, 0, true);

imc.addEventListener(MouseEvent.MOUSE_UP,DragStop,false, 0, true);

//imc.addEventListener(Event.ENTER_FRAME, onLoop,false, 0, true);

Title.text=''*''+xml.image[0].info1;

Title1.text=''*''+xml.image[0].info2;

Title2.text=''*''+xml.image[0].info3;

Title3.text=''*''+xml.image[0].info4;

var l:Loader=new Loader?;

l.x=-250;

l.y=-167;

l.load(new URLRequest(xml.image.urlimage[i]));

imc.addChild(l);

imc.scaleX=imc.scaleY=0.4;

imc.angle=i*anglePer-Math.PI/2;

imc.x=Math.cos(imc.angle)*450;

imc.z=Math.sin(imc.angle)*450;

imc.rotationY=36*- i;

container.addChild(imc);

}

}

public function staticRate():void{;

stage.frameRate=15;

}

public function animationRate():void {

stage.frameRate=30;

}

private function DragStart(event:Event):void {

trace(''Drag Started'');

container.startDrag();

}

private function DragStop(event:Event):void {

trace(''Drag Stopped'');

container.stopDrag();

}

/*private function onLoop(event:Event):void {

if (dragging==1) {

container.x=mouseX;

container.y=mouseY;

} else {

dragging=0;

event.target.stopDrag();

}

}*/

private function onClick(e:MouseEvent):void {

trace(''BUTTON: SINGLE CLICKED'');

animationRate();

var tw:GTween=new GTween(container,0.8,{rotationY:Math2.toDeg(e.currentTarget.angle+Math.PI/2),z: 100},{ease:Exponential.easeInOut,delay:0.1});

tw.addEventListener(Event.COMPLETE,completer);

}

function completer(e:Event):void {

staticRate();

}

private function clicker(e:MouseEvent):void {

trace(''BUTTON: DOUBLE CLICKED'');

var target:String=e.currentTarget.name;

var targetURL:URLRequest=new URLRequest(target);

navigateToURL(targetURL);

}

private function init():void {

container=new Sprite?;

container.x=400;

container.y=200;

container.z=400;

addChild(container);

cover.addEventListener(MouseEvent.CLICK,stageClick);

this.addEventListener(Event.ENTER_FRAME,loop);

}

private function stageClick(e:MouseEvent):void {

animationRate();

var tw:GTween=new GTween(container,0.8,{z:400},{ease:Exponential.easeInOut,delay:0.1});

mouseChildren=true;

tw.addEventListener(Event.COMPLETE,completer);

}

private function loop(e:Event):void {

SimpleZSorter.sortClips(container);

}

}

}

The site works ok for me so if there was a crossdomain policy issue it seems to have been fixed.?It appears you forgot to turn off the debug option in your publish settings and there are some null object references.?If your site is just not working on some machines it could be because flash doesn't work in 64 bit browsers.

No comments:

Post a Comment