Jump to content
Search Community

Newbie question, external swf

tin_soldier test
Moderator Tag

Recommended Posts

Hi,

 

I have a main movie file which has some tweens using TweenLite. At the end of the final tween I am calling a function to load an external swf into a container mc.

 

loadExternalSwf = function () {
loadMovie("swf/myExternalSwf.swf", "container");
}

 

This is working fine. I then have further tweens inside the external swf which work perfectly as a standalone file. Once it is loaded into the main swf however, the TweenLite class no longer seems to work. The tweens don't do anything. I have tested that this is not a pathing issue.

 

I am calling the class in the external swf on the frame with the tweens ie;

import gs.*;
import gs.easing.*;
TweenLite.from(this.myMC, 5, {_xscale:0, _yscale:0, ease:Elastic.easeOut, delay:0});

 

Can anyone see something obvious which I have wrong here?

 

Thanks

Link to comment
Share on other sites

Two things off the top of my head:

 

1) Do all your swfs use the same version of TweenLite/Max? Make sure they do. Republish them if you have to.

 

2) Is it a crossdomain issue? Are you loading swfs from a different domain than the parent swf? Flash has some security restrictions that prevent access to certain code at runtime if the swf is loaded from another domain and a crossdomain.xml file isn't in place granting permission.

Link to comment
Share on other sites

Hi, Thanks for the response. I'm using the same version yes, the fla files are in the same directory as the gs folder and both are importing the class from there.

 

There's no crossdomain issue either. I'm just testing locally and both swfs are in a folder called swf which sits in the same directory as the html file ie;

 

index.html

swf

img

js

 

I'm using swfobject v2 to embed the main swf if that's any use?

Link to comment
Share on other sites

I'm curious about something - would you please try using v11 and see if it solves the problem? You'll have to adjust your import statements:

 

OLD:

import gs.*;

import gs.easing.*;

 

NEW in v11:

import com.greensock.*;

import com.greensock.easing.*;

 

I made a ton of enhancements in v11 and there's some extra code in the AS2 version that may help get around some funkiness in older Flash Players (long story). You can get it at http://blog.greensock.com/v11beta/

 

Otherwise, please post an example FLA that demonstrates the issue (keep it as simple as humanly possible please!)

Link to comment
Share on other sites

Okay, finally figured it out. Nothing to do with TweenLite or flash at all.

 

I had the embedSWF path as an absolute path using the local ip address but was accessing the page with localhost in the url.

 

Not sure why this allowed the external swf to be loaded but it broke the tweening somehow.

 

Using a relative path has fixed it.

 

Thanks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...