AS 3.0 Issue With Loaded AS 2.0 Swf
Hello, I haven't been able to find an answer to this question anywhere.I know that an AS 3.0 swf (AVM2) can load a AS 2.0 swf (AVM1), but it will not be able to access the AS 2.0 swf's variables or functionsHoweverWhat about when you have a AS 3.0 swf (A.swf) that loads in a AS 2.0 swf (B.swf), and then B.swf is responsible for loading in an undetermined number of other AS 2.0 swfs.I've tried this, and it looks like B.swf is completely blocked with it comes to using loadMovieNum or MovieClipLoader.loadClip(), I don't seem to be getting any kind of HTTP error, which leads me to believe A.swf is smothering the request.Any insight to this problem would be greatly appreciated.Thanks, Jason
KirupaForum > Flash > ActionScript 3.0
Posted on: 10-10-2007, 07:33 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
FPS Issue With Loaded MC
Hey people,
I seem to have encountered a problem right at the end of a project im working on and i can't find a way around it. I have my main swf which runs at 40fps and i wanted to add in a spectrum analyzer effect next to the sound on/off button. (a spectrum analyzer is that thing that u see on a stereo with the moving bars ) It doesnt have to be spot on with the beat of the music, just a simple animation which i thought would be pretty simple.
I found some AS online as i was short for time and it generates the spectrum analyzer all with AS, heres the code:
Code:
function setzeEqualizer(pX, pY, pAnzahl) {
this.onEnterFrame = function() {
t++;
clip = this.createEmptyMovieClip("eq" + t, t);
//eq._x = 12;
//eq._y = 8;
this.clip._x = pX;
this.clip._y = pY;
with (this.clip) {
lineStyle(1, 0xCCCCCC, 10);
for (var i = 0; i < pAnzahl; i++) {
zufall = int(Math.random() * 8 + 3);
beginFill(0x353D53, 100);
moveTo((i * 6), 0);
lineTo((i * 6), -zufall);
lineTo((5 + i * 6), -zufall);
lineTo((5 + i * 6), 0);
lineTo((i * 6), 0);
endFill();
}
if (t == 3) t = 0;
}
};
}
setzeEqualizer(0,15,10);
So i managed to modify the style of this to fit the design im working on but when i loaded it into the mainSWF it was playing it at 40FPS, which is way too fast for this kind of animation and it looks really really spastic.
I did some research on changing the fps of a MC during runtime and i came up with this code:
Code:
starttime = newDate()
onEnterFrame=function(){
var currtime=new Date()
var ttime=currtime-starttime
while(ttime<1000/PLACE DESIRED FRAME RATE HERE){
var currtime = new Date()
var ttime=currtime-starttime
}
starttime=new Date()
}
Unfortunatly this changes the fps of the entire movie and everything then looks spastic.
My question is this - Is there a way to modify the first AS of the spectrum analyzer maybe with a "speed = 1;" kinda thing, which will make it stay at a specific FPS even after being loaded into another swf file?
Any other ideas of how i can sort this issue out would be greatly appreciated.
Frames Loaded Issue
I'm trying to set up my file so that on a button release, my externally loaded movie clip fades out and then a new MC loads in.
In the script below I'm trying to use a frame label "end" to indicate when the first mc has faded out, and then new mc should load, but it isn't working properly.
on (release) {
_root.emptyMC.gotoAndPlay("out");
if (_framesloaded = "end", emptyMC) {
loadMovie("02.swf", "_root.emptyMC");
}
}
Any help would be greatly appreciated.
thanks, Richard
Loaded Scroller Issue
This is the code I am using:
this.xDest = 0;
this.speed = 10;
this.onEnterFrame = function() {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_this._x += (this.xDest-this._x)/this.speed;
}
};
this.onMouseMove=function() {
this.xDest = 600-_root._xmouse;
}
So the code worked but I am having issues with it still. Basically
The movie works on its own when published, but does not work properly when loaded into another movie. On it's own, you move your mouse to the left end of movie, and a movieclip scrolls right untill its left end meets the mouse point. Put your mouse at right edge of movie, and the masked scrolling movieclip scrolls left untill its end meets the mouse point.
NICE!
But when loaded into another movie - which is larger, The masked scrolling movieclip no longer scrolls to meet the mouse at the left, or right edges of the movie it resides in when you place the mouse there. It scrolls to a certain point, but its end never make it ino the the border of the content frame. It's like the scrolling movie clip no longer uses the border of its movie container as a reference point, but is using the host movies border instead.
"Host Movie" (800X600)
loads "content" movie (600X374) into blank movie clip center stage.
"content" movie has a masked scrolling movie clip "scroller" (800X50) with code posted above attached to it.
What I'm after is when you mouse into the loaded movie (content) a masked movieclip (Scroller) which has the above posted code attached, will scroll left or right with the right edge of the (scroller) movieclip scrolling left to meet the right edge of the "content" movie when your mouse rest there, and vice versa. all within a larger movie this mess was loaded into.
I have been searching, and spending LONG nights trying to figure this out, and it hurts. There is some relationship issue here that I just can't figure out. I have just begun to scratch the surface of Flash, and as much as I am inspired by what you can do with it I am having quite a hard time at the moment. If anyone has any ideas please share so I can get over this hump, and explore other parts of this project in Flash.
Thanks so much again.
Tallk soon.
-Sinjun
_parent Loaded Swf Issue
Hi-
I have my main movie, I have loaded another .swf onto level 2 (on it's own, not in an empty MC)
I am trying to target a MC (typeblock) back on the main movie timeline from a button in the loaded .swf
I've tried:
_parent.typeblock._visible=false;
_parent._parent.typeblock._visible=false;
_parent._parent._parent.typeblock._visible=false;
should i have the swf load into an empty mc?
I tried a trace, but not sure what it is telling me.
_level2.one
thanks in advance-
Shawna
Caching Issue With Inner Loaded Swf
Hi, i'm loading a 2.swf into level 1 of 1.swf and in the html i have many different lines of no caching. My issue is this doesn't seem to stop the 2.swf from caching, is it even possible to stop a swf that is loaded into another from caching?
Thanks
Target Issue - Loaded MC
hey there,
i am stuck - its seems so easy, but i can't figure it out.
I have 2 swf's. swf two loads into a movieclip in swf one. swf two then loads variables into itself. Here s the code i am using.
ActionScript Code:
loadVariables("storeinfo.cfm?storeid="+storeid, this, "POST");
it is not working at all.
any ideas - thanks
Issue With Loaded SWF's KeyboardEvent Listener
I've got 2 AS3.0 SWFs -- a main SWF (mainSWF) that uses a List component as a menu interface for loading the other SWF (loadedSWF). The loadedSWF has code to move objects around within it using the keyboard (up/down/left/right keys), like so:
PHP Code:
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler)
As a standalone application, loadedSWF works as expected with keyboard interaction. However, if mainSWF loads loadedSWF, loadedSWF doesn't show up at all.
If I comment out the code in loadedSWF that relates to just Keyboard events (as in KeyboardEvent.KEY_UP above), loadedSWF will appear when mainSWF loads it, but it obviously can't respond to Keyboard events. Instead, pressing up/down keys manipulate mainSWF's List component.
Can anyone clue me in to what's going on or direct me to a thread covering a similar issue?
Thanks!
Issue With Loaded SWF's KeyboardEvent Listener
I've got 2 AS3.0 SWFs -- a main SWF (mainSWF) that uses a List component as a menu interface for loading the other SWF (loadedSWF). The loadedSWF has code to move objects around within it using the keyboard (up/down/left/right keys), like so:
PHP Code:
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler)
As a standalone application, loadedSWF works as expected with keyboard interaction. However, if mainSWF loads loadedSWF, loadedSWF doesn't show up at all.
If I comment out the code in loadedSWF that relates to just Keyboard events (as in KeyboardEvent.KEY_UP above), loadedSWF will appear when mainSWF loads it, but it obviously can't respond to Keyboard events. Instead, pressing up/down keys manipulate mainSWF's List component.
Can anyone clue me in to what's going on or direct me to a thread covering a similar issue?
Thanks!
Starting Main Swf Over From Loaded Movies (see Issue)
All,
I have tried to find exactly the solution on this forum but haven't seen it yet.
I have a swf (main.swf) that loads one of two external swf files with this actionscript:
var targets:Array = (["movie1.swf","movie2.swf"]);
var mcl:MovieClipLoader = new MovieClipLoader();
var movieNum;
if (movieNum < (targets.length - 1)) {
movieNum++;
}else{
movieNum = 0;
}
loadMovie(targets[movieNum], this.createEmptyMovieClip("pic_mc", this.getNextHighestDepth()));
var listenerObject:Object = new Object();
listenerObject.onLoadInit = function(target_mc) {
target_mc.onRelease = function() {
unloadMovie(pic_mc);
};
};
mcl.addListener(listenerObject);
Now, at the end of the loaded movies (movie1.swf and movie2.swf in this case) I have a button with:
on (release) {
gotoAndPlay (1);
}
When they were standalone movies, they started from the beginning. Now I want them to point back to the main movie if possible. Possible, how?
Or is it better to have them end (fscommand ("quit", true)) and have the main do the work?
TIA.
-Wes Yates
Memory Usage Issue With Playing A Loaded Swf
My company is currently developing a game which requires the loading of multiple movie clips from file. And my question involves memory issues with loading and playing them.
A movieclip loads up with a fairly small amount of memory used and then as they play they use a larger portion of memory, after they are done playing however it seems as if they are cached from that point on and the memory usage doesnt decrease.
Is there a way anybody knows of that after a movie clip plays the memory used from each individual keyframe can be released until it plays again, (just like it was when it loaded...) without actually unloading it and loading it back up.
Can't Control Loaded Movies... Security Issue?
I just wrote a long post and when i was finishing, the answr just came to my head... so read if your interested, i answered myself at the bottom...
------------------
Hi, I have a strange issue that might be security related. If u can help please do:
For a website y have a dinamic home, that is, it loads a movie with the most recent news. So i use some PHP and XML to get the name of the swf that finally does something like this:
loadMovieNum("themoviename.swf", 100)
Inside themoviename.swf there is a button with the actions:
on (release){
unloadmovie(100)
loadMovieNum("news.swf", 0)
}
This action does not work, y can get other things working, for the loaded movie, like: this.unload but something won't let the loaded movie control the main one.
So i tried a different approach....
I put the button inside my main movie, to have control of loading and unloading movies. But i need to make a rollover effect on the loaded movie.
So inside the news banner, ther is a animation for tag "in" and "out".
The action on main movie does something like
on (release){
unloadmovie(100)
loadMovieNum("news.swf", 0)
}
on (rollover){
_level100.gotoAndPlay("in")
}
on (rollout){
_level100.gotoAndPlay("out")
}
The rollover and rollout actions don't work either. I can manipulate the loaded movie with other properties like _visible, _x, but play(), gotoAndPlay() seemed to be blocked between main movie and loaded movie...
All of my tests work well locally, so I know it is not a script problem... but when uploaded to server, control actions between movies (play, unload) do not work.
Is anyone familiar with this issue? can it be easily solved?
By the way (maybe this is it), the main movie and the loaded movie are on diferrent servers.
Hey! call me crazy...
That last line just made the difference, that is why writting helps us to re-think our questions.
That is exactly the security issue:
if both swf are loaded from the same server you can use actionscripts between them (like, unload, play, etc). But if they are hosted on different servers somehow these actions are blocked.
Well, I answered myself, jaja, however it might help out someone out there.
[CS3]Issue With Resizing Stage While Loaded MC Is Playing
Hello,
I am trying to get a .swf file to load into a movie clip and allow the user to change the size and shape of their viewer window while the .swf file scales to fit exactly inside the movie clip as it changes. I have it working so long as the change to the window or toggle to full screen does not occur during animation.
There are three files zipped in the following location. Problem.swf loads test.swf and the source .fla file as well.
http://www.70lafayette.com/problem.zip
Thank you.
Strange Firefox Issue:Loaded Image Not Displayed
Hi all,
my first post here, so be kind please. I've come across a strange issue where externally loaded images are not displayed in my movie (AS3). After much hair pulling, I noticed that if I place an image (any image) on the stage in the first frame, everything works ok.
Has anyone come across such an issue? What I can't work out is why this is an issue in FF, and NOT in Safari/Opera?
I am using SWFObject to load the main movie into a DIV, and then setting an xmlSource var to read a XML file which holds where the images are stored.
I know the other areas of the movie are working because I can still use 'next/previous' buttons to go through the images - even though they are not being displayed - and also the image names are displayed at the bottom of the movie. I also have eventListeners set up to check for both invalid xml file location AND invalid image locations.
Anyone's help would be gratefully appreciated - thanks, mono.
Accessing Text Field In A Loaded Movie..Issue
Hello,
I have been at it for a whole day and still cannot get this working, I would highly appreciate all the help I can get with this issue. I am loading a movie called "btn.swf" from my _root. Within this movie, I have a dynamic text field called "text_inst". Before I published this movie, I named the instance "myBtn".
I am able to load the movie on _root, but cannot seem to access the textfield "text_inst.text"; I have tried using the debugger and am able to see the "text_inst" but cannot trace it. How can I access text fields in loaded movies?
Please see my code:
Attach Code
//Global gRoot is declared
_global.gRoot = this;
//Global gNext to get Next Highes Depth.
var gNext = getNextHighestDepth();
//EmptyMovieClip NAV is created
gRoot.createEmptyMovieClip("nav", gRoot.getNextHighestDepth());
gRoot["nav"]._x = 200;
gRoot["nav"]._y = 548;
//MovieClipLoader() Object is created
var loader:MovieClipLoader = new MovieClipLoader();
loader.loadClip("movies/btn.swf", nav);
I am able to trace up to _level0.nav
Combo Box Component Issue - When Loaded Stops Working
I made a swf with a combo box and loaded some info in it like this:
Code:
noteTypeCB.addItem("My Item1");
noteTypeCB.addItem("My Item2");
noteTypeCB.addItem("My Item3");
noteTypeCB.addItem("My Item4");
Then I used a load movie to load it into my main movie and when I click on the arrow to view the connents it just highlights the whole box but it does not drop down; any idea?
EDIT: I found this thread; wanted to see if anyone else found that you have to also place the combobox item in the _root FLA:
http://www.kirupa.com/forum/showthre...light=combobox
Order Issue When Displaying Pictures Loaded From An XML File
Hi,
Just a little problem a bit painful:
- loading pics from paths in an XML file,
- once loaded they are positionned one on the right of the other (depending on their specific width) as thumbnails in the bottom of the screen,
- weirdly they don't display the way they should, never in the same order and not following at all the xml order (maybe the loading order??)
Anybody's got any idea to fix this one?
My code:
Code:
private function parseXML(xmlData:XML):void {
var XMLDoc:XMLDocument = new XMLDocument();
XMLDoc.ignoreWhite = true;
var list:String = xmlData.toXMLString();
XMLDoc.parseXML(list);
arrayPics = XMLDoc.firstChild.firstChild.childNodes;
var countPicts:uint;
var nbPicts:uint = arrayPics.length;
var thumbnailName:String;
//trace(nbPicts);
for(countPicts=0;countPicts<nbPicts;countPicts++)
{
arrayPicsId[countPicts] = arrayPics[countPicts].attributes.id;
arrayPicsTitle[arrayPicsId[countPicts]] = arrayPics[countPicts].attributes.title;
arrayPicsDesc[arrayPicsId[countPicts]] = arrayPics[countPicts].attributes.desc;
thumbnailName = arrayPicsId[countPicts];
thumbnailURL = rootPictsPath+thumbnailName+"a.jpg";
var loaderThumbnail:Loader = new Loader(); //conteneur pour chaque image
loaderThumbnail.contentLoaderInfo.addEventListener(Event.COMPLETE, onThumbnailLoaded);
instanceTn = loaderThumbnail.name;
numInstanceTn = instanceTn.slice(8,instanceTn.length);
arrayPicsInstance[numInstanceTn] = thumbnailName;
loaderContext = new LoaderContext();
loaderContext.checkPolicyFile = true;
loaderThumbnail.load(new URLRequest(thumbnailURL),loaderContext); //chargement de l´image
}
}
private function onThumbnailLoaded(evt:Event):void
{
if (containerThumbnails.contains(messageLoadingTn)) //si le conteneur de vignettes contient le message de chargement
{
containerThumbnails.removeChild(messageLoadingTn); //alors il est supprimé de l´interface
}
containerThumbnails.addEventListener(Event.ENTER_FRAME, onMoveThumbnails);
containerThumbnails.addEventListener(Event.ADDED, onThumbnailAdded); //abonnement du conteneur des vignettes à l´événement Event.ADDED
var loaderThumbnail:Loader = evt.target.loader; //conteneur de l´image
ratioTn = loaderThumbnail.height / heightThumbnail; //ratio pour le redimensionnement des images
loaderThumbnail.width /= ratioTn; //largeur de la vignette
loaderThumbnail.height /= ratioTn; //hauteur de la vignette
containerThumbnails.addChild(loaderThumbnail); //ajout de la vignette dans le conteneur
}
//thumbnails position
private function onThumbnailAdded(evt:Event):void
{
var loaderThumbnail:Loader = evt.target as Loader; //la vignette qui est ajoutée
var containerTn:Sprite = evt.currentTarget as Sprite; //le conteneur des vignettes
containerTn.buttonMode = true ;
var index:int = containerTn.getChildIndex(loaderThumbnail); //l´index dans la liste d´affichage
if(index != 0) //si la vignette n´est pas la première
{
var previousX:Number = containerTn.getChildAt(index - 1).getBounds(containerTn).right; //coordonnée X du côtét droit de la vignette précédemment ajoutée
loaderThumbnail.x = previousX + gapThumbnails; //positionnement de la vignette 10 pixels après la vignette précédente
}
loaderThumbnail.addEventListener(MouseEvent.MOUSE_OVER, onThumbnailOver);
//loaderThumbnail.addEventListener(MouseEvent.MOUSE_OUT, onThumbnailOut);
loaderThumbnail.addEventListener(MouseEvent.CLICK, onThumbnailPress);
}
Thanks for your help.
Button - Embedding Font Issue W/Mask Into Loaded Movie
I have a CS3/AS3 button that is behind a mask. If I embed the font, the button label appears without a problem. However, when this SWF gets loaded into another movie, the button label is no longer visible. I followed this example - http://blogs.adobe.com/pdehaan/2008/..._with_the.html, for embedding the fonts, and was able to reproduce my issue with his example as well.
Can someone provide some insight on how to resolve this issue.
Thanks for any and all replies.
Preload Issue: Start Playing The Movie Once A Certain Frame Has Been Loaded.
I'm building a quite large flash movie with hundreds of movieclips (with their own preloaders) with approx 150 frames in the _root timeline. But I've until now never been very confident with preloaders, and that is causing me hairloss.
Once the user enter the site, I want a preloader to come up, but I want to use actionscript to start playing frame 2 once frame 2 content is loaded, not start playing frame 2 once the WHOLE movie is loaded.
I use the below code for simple preloading with no feedback of progress, however it loads the whole movie before it start playback of frame 2:
if (_framesloaded>=_totalframes) {
gotoAndPlay (2);
} else {
gotoAndPlay (1);
}
All help is greatly appreciated.
Rex
Loaded Navigation Menu Via MovieClipLoader And MouseOve Events Issue...
Hello,
I have been at it for the past two days and cannot seem to get this going, I would highly appreciate your help with this. I have movie called "menus.swf" within it, I have four nav buttons: LINK 1, LINK 2, LINK 3, LINK4.
I load this movie via MovieClipLoader on to the stage and initialize it via onLoadInit. Once it is loaded, I am able to click the links and all works well. I want to be able to use dynamic mask and show only the top part of the loaded movie so when user rolls the mouse over it, it pops up with ease and use can then click the desired link, and as soon as the mouse is not over it, movie eases back into its original position. I have tried tons of strategies such:
hitTest(), time driven event.....and so on.
I am able to load the movie without any issue but once I place an ease tween on it, Tween works but an not able to click on any nav links. I have spent hours and hours but cannot seem to get this functionality going. I would highly appreciate all your help. I am also including my files as well.
Thanks a lot
Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
_global.gRoot = this; // GLOBAL gROOT DECLARED
//MENU SHELL IS CREATED
var MenuShell:MovieClip = gRoot.createEmptyMovieClip("mShell", 1);
//MENU BACKGROUD CREATED
var MenuBg:MovieClip = MenuShell.createEmptyMovieClip("mBg", 2);
//MENU LOADER CREATED
var MenuLoader:MovieClip = MenuShell.createEmptyMovieClip("mLoader", 3);
//MENU SHELL POSITION INITIALIZED
MenuShell._x = 150;
MenuShell._y = 150;
//MOVIECLIPLOADER OBJECT CREATED
var myLoader:MovieClipLoader = new MovieClipLoader();
//MYOBJ IS DECLARED WITH FOR IN LOOP TO READ ME LOADED MENU LINKS
var myObj:Object = new Object();
//ONLOADINIT FUNCTION
myObj.onLoadInit = function(target:MovieClip)
{
for(var a in target)
{
for(var b in target[a])
{
target[a][b].onRelease = function()
{
if(target[a][b])
{
switch(this)
{
case mShell.mLoader.menus.link1:
trace("link 1");
break;
case mShell.mLoader.menus.link2:
trace("link 2");
break;
case mShell.mLoader.menus.link3:
trace("link 3");
break;
case mShell.mLoader.menus.link4:
trace("link 4");
break;
}
}
}
}
}
}
//LOADING THE MENUS.SWF IN MENULOADER MOVIE ON RUNTIME
myLoader.loadClip("movies/menus.swf", MenuLoader);
myLoader.addListener(myObj);
[/cod
Preload Issue: Start Playing The Movie Once A Certain Frame Has Been Loaded.
I'm building a quite large flash movie with hundreds of movieclips (with their own preloaders) with approx 150 frames in the _root timeline. But I've until now never been very confident with preloaders, and that is causing me hairloss.
Once the user enter the site, I want a preloader to come up, but I want to use actionscript to start playing frame 2 once frame 2 content is loaded, not start playing frame 2 once the WHOLE movie is loaded.
I use the below code for simple preloading with no feedback of progress, however it loads the whole movie before it start playback of frame 2:
if (_framesloaded>=_totalframes) {
gotoAndPlay (2);
} else {
gotoAndPlay (1);
}
All help is greatly appreciated.
Rex
[MX04] Issue: Buttons On Main Movie Are Still Active Beneath Loaded MC
Basically, I have a small interface (a large square for instance) with main and sub navigation contained in it. Using a loadMovieNum action on a button to "View More Photos", it loads a pop-up Image Viewer MC (that covers the entire large square) and presents a new mini interface and a "Close Window" button. Simple enough.
The problem is the buttons beneath the loaded MC are still active when I roll over the new interface.
Should I be using an empty MC instead? Is it an issue of transparancy?
Puzzled On Frames Loaded And Total Frames Calculation Issue
The Goal:
I am trying to find out if the last frame of a loaded swf has been completed so I can then unload that swf and replace it with another swf.
The Process:
I have on the main time line a MC called movie1. (The main time line is only one frame long)
In the first frame on the main time line I have the following code:
---- start code ----
loadMovie("test/test_movie.swf", "movie1");
if (_root.movie1.framesloaded=_root.movie1.totalframe s) {
getURL("javascript:alert("Frames Fully Loaded")");
} else {
gotoAndPlay("Scene 1", 1);
getURL("javascript:alert("Frames Not Loaded")");
}
---- end code ----
This code will load and play the movie into the MC and gives me an alert that the "Frames Not Loaded". Thats great because it means I am loading the movie correctly and testing the total frames correctly. But I need to know when the last frame of the loaded swf has played so I can then load another. Even if I take out the else statment in my testing code I still can't get it to tell me when all the frames are loaded.
Any help would be great.
Thanks
[CS3] Still Having Clock Time Zone Issue---and Dynamic Text Box Issue
I'm trying to do a clock that displays another time zone. The problem I'm having is that instead of running on a 12 hour clock, its on a 24hr one.
any insight as to how I can change the time?
Currently the clock is displaying
23:00p-Jul.22
I want it to display 11:00p-Jul.22
var dayText:String;
var dateText:String;
var monthText:String;
var AmPm:String;
_root.onEnterFrame = function() {
var myDateate = new Date();
//var sec:Number = myDate.getSeconds();
var min:Number = myDate.getMinutes();
var hour:Number = myDate.getHours();
var day:Number = myDate.getDay();
var date:Number = myDate.getDate();
var month:Number = myDate.getMonth();
//var year:Number = myDate.getFullYear();
//sec = sec<10 ? "0"+sec : sec;
min = min<10 ? "0"+min : min;
//AM/PM
if (hour>12) {
hour = hour-12;
AmPm = "p";
} else {
AmPm = "a";
}
//day
if(date == 1 || date == 21 || date == 31) {
dateText = date+"";
} else if(date == 2 || date == 22) {
dateText = date+"";
} else if(date == 3 || date == 23) {
dateText = date+"";
} else {
dateText = date+"";
}
//month
if (month == 0) {
monthText = "jan";
} else if (month == 1) {
monthText = "feb";
} else if (month == 2) {
monthText = "mar";
} else if (month == 3) {
monthText = "apr";
} else if (month == 4) {
monthText = "may";
} else if (month == 5) {
monthText = "jun";
} else if (month == 6) {
monthText = "jul";
} else if (month == 7) {
monthText = "aug";
} else if (month == 8) {
monthText = "sep";
} else if (month == 9) {
monthText = "oct";
} else if (month == 10) {
monthText = "nov";
} else if (month == 11) {
monthText = "dec";
}
//display
dateDisplay.text = hour+":"+min+ AmPm + "-" + monthText+"."+ dateText;
};
Complex Audio Issue..or Maybe Just Syntax Issue
what's up peoples. I'm building a new site for my studio and having some audio issues i can't explain very well, so here goes:
I've got an external .swf successfully loading into _level6 of my project with it's own audio. and from reading thse forums, i know that if i want to control the audio independently of other audio, i need to attach the sound object to a seperate movieclip, which i'm doing and I can control the audio just fine. However, when i click to load in a dynamic image into a dynamicly loaded movieClip, the volume button no longer works. Both the soundobject's mc and the dynamic mc's are being loaded into the nextHighestDepth() so i don't think one is kicking out the other. Here's what i've got:
Code to attach the soundObject when the section starts:
Code:
this.createEmptyMovieClip("soundstage6",this.getNextHighestDepth());
work_sound = new Sound(soundstage6);
work_sound.attachSound("myaudiofile");
work_sound.start(0, 999);
Code to control the volume:
Code:
this.testVol.onPress = function () {
this._parent.work_sound.setVolume(0);
}
Code that loads in my dynamic images:
Code:
this.testLoad.onPress = function () {
_root.attachMovie("infoClip", "infoClip", this.getNextHighestDepth(), {_alpha:0, _x:491.1, _y:193.9});
}
that testLoad button does severl other things when clicked, but when i comment out that particular line of code, the volume control button contines to work. I'm sure this has something to do with the fact that all of this is occuring on _level6 but i have no idea why or how to fix it!!!
Anybody have any ideas? Sorry for the long and complex explination!!
Mac Textinput Issue + New Player Fullscreen Issue
Please inform me if I am a total idiot,... but it appears that holding down backspace while in a TextInput on a mac will only delete one character rather than deleting chars as long as the button is held down. I have tried making the simplest project consisting of only a base sprite and a textinput, and it fails (i thought i may have been preventing the event from bubbling or something.) I tested the movie on PC and holding down backspace works fine. Is this a known issue? and so I just have to extend textInput?...
Also, it seems like when coming back from fullscreen in a swf embedded on a page causes some flickering of the swf content upon resizing the browser window, 3 people I know have also encountered this problem.
Thanks for any help,
Chris Laan
Button Issue In Flash - Program Issue
all of a sudden when i create a button and place it on stage i cant click it to drag it, scale or whatever...instead when i hover over it it behaves as in a compiled swf file (cursor changes into a hand,...).
How can i change that to the way it was? Anyone had this problem before? It is becoming really irritating.
Level Issue Or Version Issue?
hi,
wondering if anyone knows why this movie here:
http://www.pixel360.com/dev/zoompan.html
works fine as it is, but when loaded into another movie, into an MC called 'blankmc1' it will drag, but not zoom?
Also when i try exporting it as AS 2 and Flash8 the zoom handle sticks to the top of the screen?
source here:
----------------------------------------------
http://www.pixel360.com/dev/zoompan.fla
weird?
Help With Crash Issue/actionscript Issue
Hello all,
My name is Josh and I want to say thanks for even reading my post, I appreciate any help I can get. I am here at work trying to edit a flash intro I bought from templatemonster (no im not a newbie, but this is the one my boss really liked, so what he wants he gets). Im trying to edit it here and i first opened it in Flash 8 which is what i normally use. So, im editing it and usually after I edit a few things I would like to get a glimpse so i test the movie real quick. Well, everytime the "export movie" dialog box came up, it stops at about a little more than half way and the box goes away and NOTHING comes up. IT doesnt freeze, but my test movie doesnt show like something usually would. So i tried installing/uninstalling it to no avail. Finally my boss went out and purchased flash cs3 and we installed that. So im editing it again, and went to test movie, and this time it gets 3/4 way done and "flash has unexpectedly quit" etc etc. So im starting to think its something with the actionscripting maybe?? i dont know but im really frustrated and need some help here. And also, even if I tried to just plain export the movie to swf, crashes too!
Thanks everyone!
-Josh
Flash 8 Pro Issue Interval Issue
Hey, I've been working on my site for a few weeks trying to get it all just right, and I'm making it import text, to text fields from external documents, I've been using loadVariablesNum() and createTextField() to post the text onto the flash document.
ActionScript Code:
//0x393c39;
this.createTextField("forum_box",this.getNextHighestDepth(),212,3,162,120);
forum_box.wordWrap = true;
forum_box.border = true;
loadVariablesNum ("forum_txt.php", 2);
function ftv() {
if (_level2.forum_txt != undefined) {
trace(_level2.forum_txt);
forum_box.htmlText = _level2.forum_txt;
clearInterval(ftt);
}
}
var ftt:Number = setInterval(ftv, 100);
this function keeps looping, it is in a frame that is only called once, i tested this by placing a trace at the very begining , just to see if it would echo it to the output screen more than once, It seems my interval isn't stopped by clearInterval(). if anyone can see my issue here it would be greatly helpful.
Thanks
Preloader In Externally Loaded Swf Stops Working (loaded Into An Empty Movie Clip)
SEE BOTTOM OF THREAD FOR CURRENT PROBLEM
1. I have my navigation buttons in level0
2. When a button is pressed it loads an external .swf into the highest empty level
3. There is an MC in this loaded .swf called loadmovie and inside that another MC called empty.
4. Inside the 'loadmovie' MC, there is a frame action that loads another external .swf file into the 'empty' MC.
The problem I am having is that the preloader that is on the external .swf that is loaded into the 'empty' MC does not work.
It works fine if you test it on its own. But not when loaded into a Movie Clip.
MY SCRIPT:
iBytesTotal = _root.getBytesTotal();
iBytesLoaded = _root.getBytesLoaded();
iBytes = (iBytesLoaded/iBytesTotal)*100;
percentageNumber = Math.round(iBytes)+"%";
setProperty("progressBar", _xscale, iBytes);
Do I have to refrence it differently? Because of where it is situated?
e.g
iBytesTotal = _level32._root.loadmovie.empty.getBytesTotal();
confesed!
Calling A Function That Is Whithin An Externaly Loaded Clip Form Another Loaded One
I am having trouble, I am loading external movies within a target that is on another movie clip. If I call it directly in that movieclip it works. What I need to do is call it from a button that exists in another movie clip. Help Please.
on (press) {
_root.paperSlide.my_mc2.loadClip("movies/apollo.swf", "secondaryContnent");
}
my function is called my_mc2 which is located on the firs key frame of _root.paperSlide.
if after the script in _root.paperSlide I call the function like my_mc2.loadClip("movies/apollo.swf", "secondaryContnent"); it works fine. But when I try to call it from a button within another clip that is externaly loaded as well it will not work.
please help, my head hurts.
Load Bar Progress Using Bytes Loaded As Opposed To Frames Loaded
My problem now is that I would like to build a preloader with a load progress bar etc., that is based on bytes loaded rather than frames loaded.
This is because I have most of my content loading in movie clips on just 1 or 2 different frames within the movie, perhaps bad design but somewhat of a necessity due to nested clips. So, the load bar hangs on these one or two frames for a long time while preloading, whereas if it could be based on bytes loaded the load bar would have a nice gradual sliding effect. I've been playing around with it myself but have yet to get if functioning. Any help would be greatly appreciated.
Checking If Movie Loaded Into An Instance Has Fully Loaded B4 Playing
Hi,
I'm building a site that streams a series of small movies into some preset into instances on the _root timeline but are paused on an empty frame 1 until needed. So while the first movie is playing the second movie is already being loaded and is cued on frame 1 ready to play.
However, if the timeline tells the loaded movie (i.e. _root.content ) to play frame 2 before this movie has finished loading it will not play. This shouldn't happen because the movie loaded into _root.content should have loaded, but I need a failsafe.
Is there a way to run a routine once the _root timeline is finished to constantly check the status of the movie being loaded in _root.content and then play once it is loaded.
I've tried running this code in a routine:
if (_root.content._framesloaded >= _root.content._totalframes) {
_root.gotoAndPlay(2)
}
..but I'm not sure if it will work.
I really want to avoid a preloader (each movie is only about 10k big )
Any help would be greatly appreciated
Cheers
How To Make Sure Randomly Loaded Externals Swfs Are Fully Loaded [F8]
I am randomly loading external swfs into my main movie. I've got the random part working. However, I don't know how to make sure the random swf is fully loaded before jumping to a specific frame in my main movie.
I have a preloader inside each external swf, but I don't know how to make my main movie understand that the random swf is completely loaded before the main timeline should gotoandPlay("start").
What I Have So Far:
I have a blank MC (named "location") on the main stage, which I am using to hold the random swfs. On the first frame inside this MC, I have the following code:
choice = Math.round(Math.random()*2);
switch (choice) {
case 0 :
location.loadMovie("image0.swf");
break;
case 1 :
location.loadMovie("image1.swf");
break;
case 2 :
location.loadMovie("image2.swf");
break;
}
Loading the random swfs is working perfectly. But after the external swf is fully loaded, I want to move onto a frame labeled "start" on the main stage. I just don't know how to make sure the random swfs are completely loaded before I say gotoandPlay("start").
I've tried piecing together bits from so many tutorials, and I just don't know what I need to do to make it work with my current code.
Thanks so much!
Checking If A Movie Loaded With LoadMovie Loaded Succesfuly
Hi,
I have a movie called main. I want to load into a movieClip that sits in main an .swf.
To do it i use a
pictureClip.loadMovie("PR001.swf");
My question is: is there a way that the main movie can know that PR001.swf was not loaded?
Thanks fo the help.
Playing A Loaded Movie Clip (loaded In A Different Level)
I really don't understand the problem here, I'm loading a swf containing a movie clip with 2 frames with Stop(); on each. The file is loaded on _level5 so I tried this:
Code:
tellTarget (_level5.musicmc) {
gotoAndStop (2);
}
but instead of telling the musicmc movieclip to go to frame 2, it tells it to the main timeline to go to frame 2 and stop...What's the problem, when I use "Debug Movie", I can see the:
_level5
......._level5.musicmc (....... = spaces)
what's wrong, it seems to don't want to tell the MC to go to frame 2. I passed many hours on this simple d*mn thing and I really can't find out...
BTW, I'm using Flash 5
Setup Loaded Movies To Work Loaded Or Standalone
Hi Guys
How do I get a movie to work as a standalone movie - when i'm building it - and also work as a loaded movie in a parent movie that loadMovie or loadMovieNum this movie.
It just get annoying having to always change paths after I finish building my sub-movies because half the time I get it wrong - it might take me a couple of hours to get the move working as a standalone, but then i can take more hours to get it working as loaded.
any ideas??
thx
How To Reference A Loaded Swf, When Loaded Inside A Loader Component?
I am trying to control a movie (swf) that I loaded into the flash loader component. I have two files: preloader.swf and movie1.swf.
Preloader.swf has the Flash component from mx.controls.loader.
I have given this component the instance name "myLoader".
Once preloader.swf is called, it loads movie1.swf.
Movie1.swf has a button that controls the frame of a mc played within movie1.swf. When I test the movie1.swf without loading it into the preloader component, the button works as expected. However, when I load movie1.swf into the preloader.swf, it doesn't control the play of the mc.
#This is the AS I attached to button in movie1.swf when I am loading movie1.swf into the preloader.swf. Which DOESN't work.
_root.myLoader.mc1.gotoAndPlay(10);
#This is the AS I attached to button in movie1.swf when I am playing movie1.swf WITHOUT loading it into the preloader.swf. Which DOES work.
_root.mc1.gotoAndPlay(10);
I can't seem to figure out how to reference the loaded movie in the preloader.
Any help would be appreciated.
Thanks!
Problem With How Dynamic Loaded Text Is Displayed When Loaded...
Hello!
Ive been struggeling all day with this!
I found a code in this forum on how to scroll and load a .txt in a dynamic textfield in flash 2004 (thx alot timothye )
This all works, but the problem is that I cannot get it to display some text bold. the
HTML Code:
<b></b>
does not work... why?! I did the same thing in flash MX and here it works just fine!
any help will be most welcome!
I'll post the flash for u to have a look at!
thx!
Function Not Working After Clip Is Loaded, Unloaded And Then Loaded Again
I have a Movie Clip in my Library that I'm loading on to my stage using the attachMovie command. Within that movie clip, I have actions set on the first frame.
From the root level of my movie, I call "profile-section" clip by pressing a button in my nav and it loads properly and works. The functions and handlers all work correctly within it. Then when I press another button from the root level, I have code to removeMovieClip. That works and removes the "profile-section" clip.
My problem is when i click on the button to re-load the "profile-section", the function doesn't work properly anymore. I'm attaching the function for you guys to look over. Any help would be greatly appreciated. Thanks.
//
// Variables
//
var speed = 3;
//
// Sub-Section Rollover Red Bar Function
//
function subSectionRollOverLoop(movieClip, speed, distance, callBack):Void {
if (speed > 0 && movieClip._width <= distance) {
movieClip._width += speed;
} else if (speed < 0 && movieClip._width >= distance) {
movieClip._width += speed;
} else if (movieClip.__interval) {
clearInterval(movieClip.__interval);
movieClip.__interval = 0;
if (callBack) {
callBack(movieClip, speed, distance);
}
}
}
function subSectionRollOverStart(movieClip, speed, distance, callBack):Void {
if (movieClip.__interval) {
clearInterval(movieClip.__interval);
movieClip.__interval = 0;
}
movieClip.__interval = setInterval(subSectionRollOverLoop, 10, movieClip, speed, distance, callBack);
}
joan_btn.onRollOver = joan_btn.onDragOver = function ():Void {
subSectionRollOverStart(joanRoll_mc, 30, 140);
};
Urgent Loaded Movie Controlling Other Loaded Movi
I need this one done today!
I have two holder movie clips in my main .swf. One is selectloader, the other is normloader.
So selectloader.loadMov..... that works
In the select I load a selection with three boxes, the user chooses one.
When the user clicks one of the boxes I do
_root.normloader.loadMovie...
and it doesn't work!
So I created a new frame on the holder .swf for each of the three buttons so all the selectino has to to is go to another frame.
That works, but I also want each of the boxes to direct to a certain frame in normloader
so the problem comes back again
I can't get one loaded movie to control another loaded movie
I'm assuming it has to do with levels, and I need to do more then just _root.normloader.gotoAndPlay(3);
what do I have to do?
Play A Frame In A Loaded Movie From Another Loaded Swf
this is driving me crazzzzy []
i have the main movie which is 1 frame (containing the menu navagation for the site), under the 1 frame i have an MC (called scoot) that is 8 frames long and each frame has a stop action. I have set the site up to use browser back/forward button <script>
varPass=location.search.substring(1,location.searc h.length); //grab variable from cgiPass
if (parent.main.num == 1)
{parent.main.num = 2;}
else
{parent.main.num = 1;}
parent.main.controlFlash(varPass);//call controlFlash funct in main.html
document.write(varPass); //for testing purposes
</script>
the above script is a sample from the back/forward function/procedure.
Now... I labled the 5th frame of scoot as "map" and under the 5th frame, when it is played, is a button to open another swf, i'll call swf2. In swf2 is a button that i'm trying to action to go back and play map of scoot. But what ever i try nothing seems to work. Swf2 is loaded into level3 of the main movie and the loading action is in the first frame (and only frame) of the main movie. Someone please help me..... ???? Thanks a gekadrazillion in advanced !
Controlling Loaded Movies That Arent Quite Loaded Yet
Hello everyone. I am having an issue with loading an swf into an MC and having it go to a specific frame. The problem is I have one long on (press) thing going on where on press approx. 15 things happen like unloading movies loading movies etc.. The path I am using is correct I think the problem is the movie hasnt loaded yet by the time this line in the acionscript is hit. So it's like I am asking it to play a frame in a movie that hasnt loaded yet. I cant really think of a solution to this and was hoping someone here could. I thank anyone in advance for their help. I was thinking an if frame loaded thing but I really just dont know.
Checking If A Dynamically Loaded Object Is Loaded
This example deals w/ sounds, but I have a similar problem dynamically loading images so I think this is really all about dynamically loading any object in Flash MX.
If you are loading an object dynamically, how do you check to see if it's loaded?
My Example:
I'm re-using these sounds, so I'm creating a home for them like this:
mySound = new Sound(mySoundMc);
Then I load them:
mySound.loadSound("introduction.mp3", false);
Later, I'll start the sound (w/o waiting for it to load.)
mySound.start();
But if its not loaded yet, It won't play. Likewise, I imagine if an image isn't loaded yet, it won't display ... but I haven't gone down that road yet. One thing at a time.
Thanks.
_______________________
For reference this is, exactally, how I'm loaing the object.
for (i=1; i<39; i++) {
set("FrameSound" add i, new Sound(eval("McFrameSound" add i)));
eval("FrameSound" add i).loadSound("slidesounds/frame" add i add ".mp3", false);
}
Detect When Loaded Movie Is Fully Loaded
hey all,
I am trying to load an external swf into a target. when the swf is completely loaded, i want to execute the next set of actions.
Now here is the bit i'm stuck. I am trying to develop my flash websites so that no coding is done within the child swfs.
so i would assume some code like this would work:
_root.holder.loadMovie ("child.swf");
if(_root.holder.getBytesLoaded ==_root.holder.getBytesTotal){
_execute some other command;
}
However it doesn't work!!!
So is there a way to detect when a specific child swf has fully loaded into a target (not _framesLoaded please!) and then set a variable to allow some other actionscript to kick in?
please help if you know,
using mx btw
cheers,
Kd
Dynamically Loaded Swf Stops Functioning When Loaded
i have 2 very simple working swfs (main.swf and loaded.swf). Problem is, when i dynamically load one into the other, it doesn't function properly anymore.
Details - the loaded.swf that gets loaded has a dynamic scroll (reading from a txt). when i test the main.swf the entire loaded.swf scrollls and not just the text.
- files attached -
help!
|