To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Reply
 
Thread Tools Search this Thread Display Modes
Old 10-12-2004, 07:40 PM   #1
grayson_wyatt
Junior Member
 
Join Date: Oct 2004
Posts: 2
Getting UI on embedded movie to work

I'm trying to make a photo website for myself. I have a main movie that launches a picture-viewer movie. Both movies work by themselves, but when I use the code below to load the picture viewer SWF into the main movie, the controls don't work.

The non-working version is at:
http://www.graysonschaffer.com/Grays...affer_new.html
(click "portfolio" then "portraits")

The working picture viewer is at:
http://www.graysonschaffer.com/1.html

I think this may have something to do with only the main timeline getting loaded, but I have no idea how to fix it.


_root.container1.createEmptyMovieClip("container", 1);
loadMovie("/"+_global.movieToPlay+".swf","container");
container._x = -485 ;
container._y = -345 ;
grayson_wyatt is offline   Reply With Quote
Old 10-12-2004, 08:08 PM   #2
jbum
Senior Member
 
jbum's Avatar
 
Join Date: Feb 2004
Location: Los Angeles
Posts: 2,920
Look for any actionscript in the loaded movie (the one being loaded by the other movie) that uses _root, and change _root to this.

A lot of scripts use _root to refer to the main timeline of the movie which contains the script, but when the movie is loaded by another movie, _root refers to the movie doing the loading, and this can cause scripts to break.

For example, in this script:

_root.blah = x;
trace(blah);

You will get different results if the movie is loaded, because _root.blah and blah are not the same thing, as they are when the movie is run standalone.

In the sample you listed, something similar is happening with _root.container1 (it is referring to a non-existing movieclip which is attached to the loader movie, rather than the loadee movie). If you simply use

container1 or this.container1 instead of _root.container1, it will probably work.
__________________
jbum is offline   Reply With Quote
Old 10-12-2004, 08:13 PM   #3
grayson_wyatt
Junior Member
 
Join Date: Oct 2004
Posts: 2
You are a god among mortals

Thanks.
grayson_wyatt is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:43 PM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.