Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 25th, 2004, 07:31 PM
Lauri Lauri is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: San Francisco
Posts: 272 Lauri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 36 m 53 sec
Reputation Power: 5
Send a message via ICQ to Lauri
How to use onEnterFrame to load a .swf in a movie clip

Hi,

I'm pushing my Flash knowledge and have run into some problems. I have an empty movie clip called container_mc on the first frame of a movie at level 0. I first tried to load a movie into it using a button, with the code

on (release) {
loadMovie("listeningex1.swf", "_root.container_mc");
}

It worked fine. Now I would prefer to have the container_mc load the movie automatically when the main movie opens. I thought I could do it with onEnterFrame, but I'm not sure how to word the code. Can someone help? Thanks.

Reply With Quote
  #2  
Old February 26th, 2004, 02:43 AM
Tann San Tann San is offline
Gotta get to the next screen..
Click here for more information.
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,584 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 7835 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 5 h 57 m 29 sec
Reputation Power: 534
Facebook MySpace
Hi, you must first select the blank movie clip on stage. Once selected open the actionscript window and enter:
Code:
onClipEvent(load) 
   {
      this.loadMovie("listeningex1.swf");
   }
__________________
-Tann

-Vote for your favorite ActionScript editor here.

Reply With Quote
  #3  
Old February 26th, 2004, 10:49 AM
Lauri Lauri is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: San Francisco
Posts: 272 Lauri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 36 m 53 sec
Reputation Power: 5
Send a message via ICQ to Lauri
Quote:
Originally Posted by Tann San
Hi, you must first select the blank movie clip on stage. Once selected open the actionscript window and enter:
Code:
onClipEvent(load) 
   {
      this.loadMovie("listeningex1.swf");
   }


Aha! Thanks a lot. I will try it when I get home from work.

Reply With Quote
  #4  
Old February 26th, 2004, 09:59 PM
Lauri Lauri is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: San Francisco
Posts: 272 Lauri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 36 m 53 sec
Reputation Power: 5
Send a message via ICQ to Lauri
Well, I selected the movie clip, put the code on it, but I can't get it to work. Any other ideas?

Reply With Quote
  #5  
Old February 27th, 2004, 03:09 AM
Tann San Tann San is offline
Gotta get to the next screen..
Click here for more information.
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,584 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 7835 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 5 h 57 m 29 sec
Reputation Power: 534
Facebook MySpace
Hi, ok lets try another approach then :¬) In the first keyframe of container_mc's parent movie, I'm going to assume that's _root for now:
Code:
_root.container_mc.onLoad = function()
   {
       _root.container_mc.loadMovie("listeningex1.swf");
   }

Reply With Quote
  #6  
Old February 27th, 2004, 03:18 AM
Lauri Lauri is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: San Francisco
Posts: 272 Lauri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 36 m 53 sec
Reputation Power: 5
Send a message via ICQ to Lauri
Oddly enough, that one didn't work, but putting
loadMovie("listeningex1.swf", "_root.container_mc");
in the first frame did. Now to find my next problem

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > How to use onEnterFrame to load a .swf in a movie clip


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway