<

Go Premium for a chance to win a PS4. Enter to Win

x

AVMovie1 and AVMovie2

Published on
8,982 Points
2,482 Views
Last Modified:
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions.

Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share.  I developed a flash site in AS3.0 but due to some constraints I had to use the home page of another Flash movie developed in AS2.0; so basically I was loading a AVMovie1 movie into another AVMovie2 movie.

I had a Tween created in my home.swf which worked well on first load within AVMovie2. But the problem started when I navigated to another section and again returned to Home. This time, surprisingly, none of the Tweens in home.swf worked!  I checked multiple times to be sure that when I navigated, I cleared my home loader which I added to the base flash movie.

After much debugging, I changed my Tween class to use GreenSock AS2.0 version in home swf. Still the same thing happened; individually the home ran absolutely fine, but when called through the base movie, all the tweens ran perfect only for the first time.

I actually wasted my whole day at it but was lucky enough to get to a solution at the end of the day.

I came to know that when an AS2/AS1-based swf is subloaded into an AS3-based one, then unloaded, and another one is loaded subsequently, a bug in the Flash Player prevents the onEnterFrame from working properly and the _root reference becomes invalid.

The source of my knowledge was from the code comments provided in TweenLite class.

The code which did the trick was to add this line:
TweenLite.jumpStart(_root) ;

Open in new window


Please note: I used this._lockroot() in the home.swf also.

I hope this will help someone to avoid wasting time in such scenario.

This article was originally published on my blog.
0
Comment
0 Comments

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Join & Write a Comment

The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
Suggested Courses

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month