[Flashcoders] LocalConnection problem...

2009-06-24 Thread BOYD SPEER
I have two .swf's in a web page - one is embeded in the body of the page and 
the other is loaded into an iFrame on the same page (it is not embeded in 
html.). I want to send and receive data from the first one (a menu) to the 
second one but no luck...

I know that both LocalConnection objects are created and that the sending 
function is being called but the receiving LocalConnection object does not get 
the message...both return 'localhost' as their domain. 

Any ideas what I am doing wrong?

Thanks,
-Boyd

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] LocalConnection Problem

2006-07-26 Thread Jessica Hensley
Is anyone aware of problems using a localConnection on different
browsers and on Mac versus PC? I'm working on a project in which I have
two Flash files running on an HTML page and the first file sends a
"cookie" to the second file using a localConnection. The complication is
that the first file loops a series of secondary Flash movies in and out
and when each of those movies switches, it needs to send a new frame
number to the second movie. I've been working on this for several weeks
and have gone through several versions of the files, some of which work
on Firefox/PC, some work on IE/PC, some have occasionally worked on the
Mac browsers. Code in the sending file is below. Also below is a link to
the HTML page that is holding the two movies.

Not an expect AS programmer, so I won't be insulted by any major
critiques of the code. Any help is greatly appreciated!

http://www.h2xmultimedia.com/clients/_select/index.html

Sending File Code:

var frames:Array = new Array("2","62","122","182","242","302");
var clips:Array = new Array("images/bars/bar1.swf",
"images/bars/bar2.swf", "images/bars/bar3.swf", "images/bars/bar4.swf",
"images/bars/bar1.swf", "images/bars/bar2.swf");

waitDelay = 7.5; //in seconds

imageCount = -1;
frameCount = -1;
onTop = createEmptyMovieClip('holder_1', 1);
onBottom = createEmptyMovieClip('holder_2', 2);
onTop._alpha = 100;
onBottom._alpha = 0;
holder_1._lockroot = true;
holder_2._lockroot = true;

loadNextImage = function () {

onBottom.loadMovie(clips[imageCount=(imageCount+1)%clips.length]);

//send the next frame number - WORKS PERFECTLY IN
TESTING ENVIRONMENT BUT NOT IN BROWSERS
function sendFrameNumber(bnum){
outgoing_lc = new LocalConnection();
outgoing_lc.send("lc_test", "testme", bnum);
delete outgoing_lc;
}

sendFrameNumber(frames[frameCount=(frameCount+1)%frames.length]);

//fade the images
onEnterFrame = function() {
if (onBottom._width>0) {
crossFade(onTop,onBottom);
onEnterFrame = null;
}
}
}


waitTime = function (seconds) {
waitId = setInterval(function() { 
loadNextImage();clearInterval(waitId);}, seconds*1000);
};
loadNextImage();

function crossFade(clip1,clip2) {
cross = function (clip1, clip2) {
clip1._alpha -= 5;
clip2._alpha += 5;
if (clip2._alpha >= 100) {
temp = onTop;
onTop = onBottom;
onBottom = temp;
clip1.swapDepths(clip2);
waitTime(waitDelay);
clearInterval(fadeId);
}
updateAfterEvent();
};
fadeId = setInterval(cross, 2, clip1, clip2);
}

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] LocalConnection problem...

2009-06-24 Thread allandt bik-elliott (thefieldcomic.com)
could you post your local connection code on both swfs plx?

a

On Wed, Jun 24, 2009 at 2:46 PM, BOYD SPEER  wrote:

> I have two .swf's in a web page - one is embeded in the body of the page
> and the other is loaded into an iFrame on the same page (it is not embeded
> in html.). I want to send and receive data from the first one (a menu) to
> the second one but no luck...
>
> I know that both LocalConnection objects are created and that the sending
> function is being called but the receiving LocalConnection object does not
> get the message...both return 'localhost' as their domain.
>
> Any ideas what I am doing wrong?
>
> Thanks,
> -Boyd
>
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] LocalConnection problem...

2009-06-24 Thread BOYD SPEER
Thanks, a,
But I have taken a different approach using ExternalInterface which seems to 
work now...


- Original Message -
From: "allandt bik-elliott (thefieldcomic.com)" 
Date: Wednesday, June 24, 2009 10:59 am
Subject: Re: [Flashcoders] LocalConnection problem...
To: Flash Coders List 

> could you post your local connection code on both swfs plx?
> 
> a
> 
> On Wed, Jun 24, 2009 at 2:46 PM, BOYD SPEER  wrote:
> 
> > I have two .swf's in a web page - one is embeded in the body 
> of the page
> > and the other is loaded into an iFrame on the same page (it is 
> not embeded
> > in html.). I want to send and receive data from the first one 
> (a menu) to
> > the second one but no luck...
> >
> > I know that both LocalConnection objects are created and that 
> the sending
> > function is being called but the receiving LocalConnection 
> object does not
> > get the message...both return 'localhost' as their domain.
> >
> > Any ideas what I am doing wrong?
> >
> > Thanks,
> > -Boyd
> >
> > ___
> > Flashcoders mailing list
> > Flashcoders@chattyfig.figleaf.com
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> 
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders