Skip navigation
RoyaFuze777
Currently Being Moderated

What is LocalConnection and how does it work?

Feb 11, 2013 11:02 PM

Tags: #as3 #xml #as2 #actionscript3 #gallery #localconnection #actionscript2 #swfbridge

So I've been having problems loading XML images into a flash image gallery. The lowdown is that while the gallery works perfectly when it is standalone, I can't seem to get the images to display at all when loading it into another swf (my flash site). I have searched for ages and I still cannot figure it out.

 

To keep this post short, everything is detailed in this thread:

http://forums.adobe.com/message/5045059#5045059

 

I came across something called "LocalConnection" or "SwfBridge" that helps an AS3 file communicate with an AS2 file:

http://gskinner.com/blog/archives/2007/07/swfbridge_easie.html

 

Because I am quite noob, I have no clue as to what I'm supposed to do. I tried just copying and pasting these codes into my swfs:

 

// in the AS2 SWF:

var myBridge:SWFBridgeAS2 = new SWFBridgeAS2("connectionID", clientObj);

// in the AS3 SWF:

var myBridge:SWFBridgeAS3 = new SWFBridgeAS3("connectionID", clientObj);

 

But it came back with this error when testing it out in the AS3 flash site file:

Symbol 'gallery_mc', Layer 'Layer 1', Frame 1, Line 11046: Type was not found or was not a compile-time constant: SWFBridgeAS3.

 

And this error in the AS2 XML gallery file:

Scene=Scene 1, layer=actions layer, frame=1, Line 1The class or interface 'SWFBridgeAS2' could not be loaded.

 

I'm almost certain I'm doing this entirely wrong. How do I actually use the swfbridge and could it be a potential solution to my frustrating problem?

 

Thank you.

 
Replies
  • Currently Being Moderated
    Feb 12, 2013 1:09 AM   in reply to RoyaFuze777

    The compiler can`t find the class files for SWFBridge.

    Easiest way to fix tihis:

    1.Download SWFBridge here

    2.extract the contents of the com-folder (with com) inside the zip file into the directory that contains your gallery source flas.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 13, 2013 12:58 PM   in reply to RoyaFuze777

    After going over your last thread (the one you linked above) I must honestly say, that I doubt your problems will be fixed soon. I don`t mean to be discouraging, but with your beginners knowledge trying some esoteric techniques like LocalConnection to get to work with a encapsulated solution you bought and have no knowledge of inner workings is pointless.

    If you analyze your problem it lies here:

    The lowdown is that while the gallery works perfectly when it is standalone, I can't seem to get the images to display at all when loading it into another swf (my flash site).

    ...

    I used this AS3 "loader" to load the .swf into my flash site.

    Why do you have to load the gallery via a loader? Why not considering a solution like completely seperating the two things (AS3site/AS2gallery) and maybe using a JavascriptLightbox to show the gallery as overlay on your website?

    Just my 2 cents.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points