F8 - Added A Preloader Now As Animation Not Working..
Any idea why this wouldn't work once a preloader is added to scene before content?this.onLoad = function() { a = 1; //duration = 1; //Use a fractional number to //cut the duration: duration = 0.92; maxang = 30; speed = 1;}this.onEnterFrame = function() { setProperty(_root.content.chandelier, _rotation, (((Math.sin (speed*a))*(Math.pow (duration, a ))))*maxang); a = a+0.1;}
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 05-05-2007, 07:26 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
SSP MovieClip Does Not Play Animation Once Instance Name Is Added
Hello all,
I am adding SlideShowPro to my website. I am not thrilled with the basic default navigation that SSP has so I've decided to add my own custom navigation buttons. According to the SlideShowPro manual, you can add "external" flash buttons to your slideshow and place them anywhere in the movie as long as you follow some simple steps. I did all the steps, but the issue is, my movieclip has another button embedded in it to create a rollover effect. As soon as I give my movieclip the proper instance name, the animation doesn't work. I've spent two days on the SSP forums trying to find an answer, and no one can seem to help me. These are the steps I followed:
1. Assign the SlideShowPro element an Instance Name like "my_ssp".
2. Create a movie clip that will act as the button to interact with SlideShowPro. Name it according to it's task, like "nextImageGroup_btn", and assign it the same Instance Name.
3. Then add this ActionScript to the first empty frame in the .fla timeline:
CODEnextImage_btn.onRelease = function() {
my_ssp.nextImage();
}
prevImage_btn.onRelease = function() {
my_ssp.previousImage();
}
nextImageGroup_btn.onRelease = function() {
my_ssp.nextImageGroup();
}
prevImageGroup_btn.onRelease = function() {
my_ssp.previousImageGroup();
}
Actions Not Working When Bitmaps Added To Scene
I've been trying to work around this issue for the last few hours. In my document I have a bitmap background, and a few other bitmaps I exported from Photoshop. Whenever I try to assign actions to buttons, it says the selection cannot have actions assigned. However, when I make a new document, and make a button from native tools in Flash (text, create rectangle), actions can be assigned.
Has anyone else had this problem, and know how to fix it?
Array Stops Working After 8 Elements Are Added To It
This is mystifying. The following array,
Code:
mcRotation = [000, 001, 002, 003, 004, 005, 006, 007];
works just fine as is (well, it generates no errors). But as soon as I add one more element to it, 008, it generates an error:
**Error** Symbol=alphabet bar graphics, layer=actions, frame=1:Line 8: ']' or ',' expected
I might as well forget about inputing the rest (up to 025). Just to verify, here it is up to 008 as I'm typing it:
Code:
mcRotation = [000, 001, 002, 003, 004, 005, 006, 007, 008];
You're probably wondering what's with the extra leading zeroes, well they are there for spacing purposes to help me keep track of which element in the array I am working on. Here's what the whole thing looks like so far:
Code:
// [000, 001, 002, 003, 004, 005, 006, 007, 008, 009, 010, 011, 012, 013, 014, 015, 016, 017, 018, 019, 020, 021, 022, 023, 024, 025];
mcPosY = [000, 001, 002, 003, 004, 005, 006, 007, 008, 009, 010, 011, 012, 013, 014, 015, 016, 017, 018, 019, 020, 021, 022, 023, 024, 025];
mcRotation = [000, 001, 002, 003, 004, 005, 006, 007, 008, 009, 010, 011, 012, 013, 014, 015, 016, 017, 018, 019, 020, 021, 022, 023, 024, 025];
mcLetters = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"];
ugly, huh.
On a side note, you "create more dynamic code" guys would be proud of me. I generated an array of 26 elements each incremented by 12.3077 using the following function:
Code:
var mcPosX:Array = new Array();
for(var i = 0; i < 25; i++){
mcPosX[i] = i * 12.3077;
}
Mouse Over Menus Not Working When Flash Video Is Added
Hello,
We have a navigation menus in our oracle portal, which few are mouse over drop down menus. When a flash movie is added to the page, the mouse over drop downs doesn't work. If we remove the flash video, it works. This problem only happens on IE6. In IE7 and firefox doesn't have this issue.
What could be the reason for this? Any help is highly appreciable because it is very rgent, we have release by end of this week.
Thanks
Pasted below is the code
Attach Code
***
<object type="application/x-shockwave-flash" data="http://dddd.swf" id="FlowPlayer" height="270" width="360">
<param name="movie" value="http://ddd.swf" />
<param name="quality" value="high" />
<param name="scale" value="noScale" />
<param name="wmode" value="transparent" />
<param name="flashvars" value="config={videoFile: 'http://dd/1/134263.FLV', autoPlay: false, loop: false, showMenu: false, initialScale: 'orig' }" /></object>
Edited: 10/17/2007 at 08:28:09 PM by ajesing
Movie Clip Added Using AddChild() Plays Animation Before Loaded To Main Timeline...
In my main timeline I have a movie clip (cursor_mc) that is loaded from the library using addChild(). It works and loads the movie clip, but the animation within cursor_mc is already done. I want the animation to start once the clip is loaded. This should be easy for the action script experts out there, I'm pretty new at this. Thanks for any help!
Yugop Style Menu Stop Working When Link Added
Hi
I have based this project on an old source of a yugop menu (see file below)
Thing is that as soon as I add the string for loading a different swf (or any other code for what it matters) the animation stops working. EI the stretching stops.
What Am I missing????
This is how the tabs items are defined
ymenu_mc.addItem("01",{text:" CONTACT", color:0xFF0000});
ymenu_mc.addItem("02",{text:" LOOKBOOK", color:0x00FF00});
etc etc
This is the code I wrote
ymenu_mc.item0_mc.onRelease = function() {
loadMovieNum("ads.swf", 0);
};
The animations is defined in a script within the textfield (again see file attatch)
Am have tried and tried...Please help
respect
FV
Mouse Wheel Scrolling Stops Working In IE Once A Component Is Added.
I want viewers to be able to use the mouse wheel to scroll my HTML page. As soon as they click on my Flash portion of the page the mouse wheel becomes disabled. I noticed it works until I start adding Flash Form Components to the page. After I add the components the scroll wheel stops working.
I don't want to scroll inside flash. I want it to scroll the actual IE scroll bar.
My sample form is located at:
http://www.oahure.com/NewProject2/SF_Search3.php
Edited: 04/02/2006 at 06:18:20 PM by OahuRE.com
Help Trashed Bitmaps When Preloader Added
This stinks!! I finished a project with a big reel of jpegs converted to clips no problem and have about 15 layers of assorted clips on the main timeline. Now, when I tried to add preloader code to the first frame it worked but then when I tested the movie the clips were pixellated and horrible. I went back and removed the preloader code/keyframe and the clips returned to normal. Mac OS 9.1 and a big headache. Has anyone heard of this? Can I use a blank clip or code in another movie to load the main movie as a separate swf using some type of getBytesLoaded/getBytesTotal deal? What a shock!! On top of that, when I tried to drag frames right to get content out of frame one I got at least three complete screen freezes that required restarts. (I had to move everything to frame two so the preloader code stood alone on frame one.) Any help is appreciated. Thanks.
Sound Not Playing After I Added An Internal Preloader
Ok... I am slowly trying to get all of the pieces to this flash file working...
FYI -- Major Newb!
I added this preloader to a flash file that was working..
http://www.tutorialized.com/view/tut...reloader/14517
After adding the preloader I:
I moved all content files to begin on the 5th frame.
I am using actionscript to allow people to pause, stop, and play sound.
The sound is launched with the following script and required me to right click the sound file in select linkage, export for actionscript and name the file (Sound).
Here is the sound actionscript
s = new Sound();
s.attachSound("Sound");
i=1;
function timeme (){
now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
_root["nowtime"+i] = (Number(hours)*3600)+(Number(minutes)*60)+seconds;
_root.newstarttime = _root["nowtime"+i] - _root.nowtime1;
i++;
}
s.start();
timeme();
after adding the preloader I can't seem to get the sound to work. I set the action to start on the 5th frame and many other tweaks and can't seem to get it to work. I am guessing there is a conflict between how the sound is loaded and the preloader.
The sound works if I check the export on first frame box but this prevents the preloader from loading quickly and there for defeats the purpose.
I like the preloader and would like to see if I can get the sound to function with it and not visa versa.
Thanks in advance.
Scott
http://www.produce-market.com
Edited: 10/16/2007 at 06:41:45 PM by producemarketing
Placeholder Ext Images Messed Up When I Added A Preloader?
Hi all. I had this animation which was working perfect until I had to add a preloader, now that I have added the preloader the placeholder does not load the external images.
The code I used for my placeholder is like this:
[as]//Active Menu Disabled.
Stage.showMenu = false;
// This is relative to the gfx folder. Any additional images must be placed inside the gfx folder. Trevor Saint
pics=["gfx/photo01","gfx/photo02","gfx/photo03"];
randpic = pics[random(pics.length)];
_root.placeholder.loadMovie(randpic+".jpg");[as]
But this now appears to be missed for some reason. I had to add a new KFrame making two in total for the preloader. Can anyone help me fix this problem?
thx
Added Preloader.....which Works, But Then Buttons In The Swf Don't Work
Hi.
Sorry, I have looked all throughout this site, and done multiple searches over the last few days, but still haven't figured this preloader out. From other posts I'm getting the impression that the tutorials for flash mx don't work for mx04.
I've done a good half dozen tut's on other preloaders aswell, which work....but all of them make my buttons ( that call in other external swf's) not function. Everything works beaut, without the preloader, so I imagine there is some conflict in paths.
The buttons in the main swf have
on (release) {
_parent.contents.loadMovie("1.swf");
}
I've tried swapping parent to root and to this. I've tried calling in levels, but it still ends up the same.
I appologize for another preloader thread, but I have been learning everything from the tutorials and forums at kirupa, and would be grateful for your help.
Cheers!
Mark
Placeholder Ext Images Messed Up When I Added A Preloader?
Hi all. I had this animation which was working perfect until I had to add a preloader, now that I have added the preloader the placeholder does not load the external images.
The code I used for my placeholder is like this:
[as]//Active Menu Disabled.
Stage.showMenu = false;
// This is relative to the gfx folder. Any additional images must be placed inside the gfx folder. Trevor Saint
pics=["gfx/photo01","gfx/photo02","gfx/photo03"];
randpic = pics[random(pics.length)];
_root.placeholder.loadMovie(randpic+".jpg");[as]
But this now appears to be missed for some reason. I had to add a new KFrame making two in total for the preloader. Can anyone help me fix this problem?
thx
Added Preloader.....which Works, But Then Buttons In The Swf Don't Work
Hi.
Sorry, I have looked all throughout this site, and done multiple searches over the last few days, but still haven't figured this preloader out. From other posts I'm getting the impression that the tutorials for flash mx don't work for mx04.
I've done a good half dozen tut's on other preloaders aswell, which work....but all of them make my buttons ( that call in other external swf's) not function. Everything works beaut, without the preloader, so I imagine there is some conflict in paths.
The buttons in the main swf have
on (release) {
_parent.contents.loadMovie("1.swf");
}
I've tried swapping parent to root and to this. I've tried calling in levels, but it still ends up the same.
I appologize for another preloader thread, but I have been learning everything from the tutorials and forums at kirupa, and would be grateful for your help.
Cheers!
Mark
Preloader Not Loading Objects Added At Runtime
Morning! I'm very sorry, it's another preloader question...
My preloader is working fine, but objects that are added at runtime using attachMovie() don't show up, unless I tell them to export in first frame. Then, of course, my preloader sits on its arse until it's about 60% loaded, which isn't great. Might it be something to do with me having the movie split into a number of scenes?
This is my PL code, located on frame 2:
Code:
var percentLoaded = Math.round((_root.getBytesLoaded()/_root.getBytesTotal())*100);
loadingText = percentLoaded+"% loaded...";
if (_root.getBytesLoaded() != _root.getBytesTotal()) {
gotoAndPlay(1);
}
TIA,
Tom
Kirupa Portfolio W/loader And Preloader And Border Added
As per: http://www.kirupa.com/web/xml/examples/portfolio.htm
I am not sure if anyone would be interested in this, but I added a progressbar and loader for the main image loading in the tutorial, added a API-drawn border and put it into a movie clip that I attach various galleries to by button simply by calling a reference to the appropriate xml file in the button. For my site, it needed to load all images of various sizes to a right location, hence the weird math...and it seems to have a minor glitch in the loading which I can't figure out occasionally (in IE anyways, less often in FF) if anyone knows what's wrong,
Here's what it looks like (I'm trying to rebuild my site from scratch, so please excuse the appearance): http://www.faceitphoto.ca/XML/main.html
The appropriate code is below and I'll link to a zip with I hope everything required to make it run as-is:
This is in the XML-generating movieclip that gets attached via a button:
var thumb_spacing = 40;
function GenerateXMLfile(loadContent_xml) {
var portfolioPictures = loadContent_xml.firstChild.childNodes;
//create scrollpane menu_mc and insert thumbnail_mc per gallery
for (var i = 0; i<portfolioPictures.length; i++) {
var currentPicture = portfolioPictures[i];
var currentThumb_mc = menu_mc.createEmptyMovieClip("thumbnail_mc"+i, i);
currentThumb_mc._x = i*thumb_spacing;
currentThumb_mc.createEmptyMovieClip("thumb_contai ner", 0);
currentThumb_mc.thumb_container.loadMovie(currentP icture.attributes.thumb);
currentThumb_mc.title = currentPicture.attributes.title;
currentThumb_mc.image = currentPicture.attributes.image;
currentThumb_mc.description = currentPicture.attributes.description;
currentThumb_mc.bgcolor = currentPicture.attributes.bgcolor;
currentThumb_mc.onRollOver = currentThumb_mc.onDragOver=function () {
bg_txt.text = this.bgcolor;
info_txt.text = this.title;
_root.description_txt.text = (this.description);
};
currentThumb_mc.onRollOut = currentThumb_mc.onDragOut=function () {
bgText.text = "";
info_txt.text = "";
};
currentThumb_mc.onRelease = function() {
_global.theCurrentImage = this.image;
_root.description_txt.text = (this.description);
_global.myGlobalColor = this.bgcolor;
_root.back.colorTo(myGlobalColor, 3, "linear");
doLoadImage();
};
}
}
// xml object for xml content (defines sources for selections)
var loadContent_xml = new XML();
loadContent_xml.ignoreWhite = true;
loadContent_xml.onLoad = function(success) {
if (success) {
GenerateXMLfile(this);
} else {
trace("Error loading XML file");
}
// no success? trace error (wont be seen on web)
};
// load
loadContent_xml.load(_root.theCurrentSubFile_xml);
//the bulk of the new stuff follows
function addBorder() {
this.createEmptyMovieClip("rectangle_mc", 1002);
//rectangle_mc._alpha=0;
rectangle_mc._x = strokeX;
rectangle_mc._y = strokeY;
strokeColor = myGlobalColor;
strokeAlpha = 100;
drawRoundedRectangle(rectangle_mc, strokeWidth, strokeHeight, 10, 0xFF0000, 0);
//rectangle_mc.alphaTo(100,2);
function drawRoundedRectangle(target_mc:MovieClip, boxWidth:Number, boxHeight:Number, cornerRadius:Number, fillColor:Number, fillAlpha:Number):Void {
with (target_mc) {
beginFill(fillColor, fillAlpha);
lineStyle(6, strokeColor, strokeAlpha, true);
moveTo(cornerRadius, 0);
lineTo(boxWidth-cornerRadius, 0);
curveTo(boxWidth, 0, boxWidth, cornerRadius);
lineTo(boxWidth, cornerRadius);
lineTo(boxWidth, boxHeight-cornerRadius);
curveTo(boxWidth, boxHeight, boxWidth-cornerRadius, boxHeight);
lineTo(boxWidth-cornerRadius, boxHeight);
lineTo(cornerRadius, boxHeight);
curveTo(0, boxHeight, 0, boxHeight-cornerRadius);
lineTo(0, boxHeight-cornerRadius);
lineTo(0, cornerRadius);
curveTo(0, 0, cornerRadius, 0);
lineTo(cornerRadius, 0);
endFill();
}
}
}
function doLoadImage() {
this.createClassObject(mx.controls.Loader, "loader1", 1000);
//loader1.scaleContent = false;
this.createClassObject(mx.controls.ProgressBar, "progressbar1", 1001);
progressbar1._x = 700;
progressbar1._y = 500;
function progress(eventObject:Object) {
var alreadyLoaded = eventObject.target.getBytesLoaded();
var total = eventObject.target.getBytesTotal();
progressbar1.setProgress(alreadyLoaded, total);
}
function complete() {
progressbar1.setVisible(false);
var image_mc:MovieClip = loader1.content;
image_mc._x = (Stage.width-(image_mc._width))-45;
image_mc._y = Stage.height/(image_mc._height)+47;
_global.strokeWidth = image_mc._width;
_global.strokeHeight = image_mc._height;
_global.strokeX = image_mc._x;
_global.strokeY = image_mc._y;
loader1._alpha = 0;
doReveal();
}
function doReveal() {
loader1.setVisible(true);
addBorder();
loader1.alphaTo(100,2);
}
loader1.addEventListener("progress", progress);
loader1.addEventListener("complete", complete);
progressbar1.mode = "manual";
loader1.contentPath = theCurrentImage;
loader1.setVisible(false);
}
Here's the complete download to all that should be needed if anyone is interested:
http://www.faceitphoto.ca/XML.rar
Does anyone know how to put the menu for the thumbs into a ScrollPane? I can't figure that out, and I'd like my whole site to be driven by components that I tweak and create dynamically on the fly - it's a great way for me to learn and prep myself for Flex 2 which I'm hoping to venture into. I'm VERY new at all this...as my persistent use of the help files and some probably really retarded logic probably shows
I hope this post proves useful (and not offensive) to anyone...
Shawn
How Is This Animation Working ?
how is this working ?
pls view the attatched zip file.
[ rightclick-save as]
http://www.geocities.com/jagmytri/flash/2stretch.zip
I am just trying to dissect and understand this fla file.
can anybody..tell me exactly
how is this animation is done?
or,
can i get a simpler version of it with the same effect ?
Though, I referred to it so many time, I am confused
Animation Not Working
I have put an animation with the loading bar and text, the animation works fine in Test movie but it doesn't work in streaming or when it is uploaded why? http://www.users.bigpond.com/matildasec/teddy.htm
Animation Not Working
I'm creating a slideshow where each slide has an image that is overlaid with text, with a semi-opaque background behind the text for readability. Each slide animates in by "pushing" the previous slide off the stage. I have this animation working fine with the images, but when I use the same approach for the movie clips containing the text and text bg, the text will animate IN but not OUT. Here is my code (I'm using TweenLite for the tweening) -- the code where I'm doing the animation is in bold:
Code:
package ticker {
import flash.text.*;
import flash.display.Sprite;
import flash.display.MovieClip;
import gs.TweenLite;
class HeadlineItem extends Sprite {
var label1:TextField = new TextField();
var label2:TextField = new TextField();
var bar1:Sprite = new Sprite();
var bar2:Sprite = new Sprite();
var myLabel:TextField;
var oldLabel:TextField;
var myBar;
var oldBar;
var headline:String;
var count:Number;
function HeadlineItem(head:String,num:Number) {
this.headline = head;
this.count = num;
configText();
}
function configText() {
alternateClips();
myLabel.autoSize = TextFieldAutoSize.CENTER; //makes the text field the same size as the text it contains
myLabel.wordWrap = true;
myLabel.multiline = true;
myLabel.selectable = false;
myLabel.x = 10;
myLabel.y = 700 - myLabel.textHeight;
myLabel.width = 1240;
myLabel.styleSheet = createStylesheet();
myLabel.htmlText = "<body>"+headline+"</body>";
myLabel.backgroundColor = 0xffffff;
//myLabel.embedFonts = true;
makeBg(myLabel.x, myLabel.y, myLabel.width, myLabel.textHeight);
}
function makeBg(labelX:Number, labelY:Number, labelW:Number, labelH:Number) {
var barX = 0;
var barY = labelY - 20;
var barW = labelW + 40;
var barH = 800 - barY;
myBar.graphics.clear(); //clears the sprite
myBar.graphics.beginFill(0x000000, 0.4);
myBar.graphics.drawRect(barX,barY,barW,barH);
myBar.graphics.endFill();
//add the background
addChild(myBar);
myBar.addChild(myLabel);
TweenLite.from(myBar, 2, {x:1280});
TweenLite.to(oldBar, 2, {x:0-1280});
}
function createStylesheet():StyleSheet {
var body:Object = new Object();
body.fontFamily = "NYTCheltenham-MediumItalic";
body.fontSize = 48;
body.color = "#ffffff";
var style:StyleSheet = new StyleSheet();
style.setStyle("body", body);
return style;
}
function alternateClips() {
if (count % 2 == 0) {
this.myLabel = this.label1;
this.oldLabel = this.label2;
this.myBar = this.bar1;
this.oldBar = this.bar2;
}
else {
this.myLabel = this.label2;
this.oldLabel = this.label1;
this.myBar = this.bar2;
this.oldBar = this.bar1;
}
}
}
}
Animation Not Working...
Hi,
can anyone see why my animation for my preloader aint working? the preloader works fine but i cant seem to get the percentage loaded to match the frame of my animation :
PHP Code:
package {
import flash.display.*;
import flash.events.*;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.net.URLRequest;
public class intro extends MovieClip {
//private var go here
private var eBtn;
private var ldr;
private var fadeTween:Tween;
private var loader:Loader = new Loader();
public function intro() {
init();
}
private function init():void {
//sample code goes here
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
eBtn = new enterBtn();
addChild(eBtn);
eBtn.addEventListener(MouseEvent.CLICK, onClickenterBtn);
ldr = new preloader();
addChild(loader);
loader.addEventListener(MouseEvent.CLICK, onClickenterBtn);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onEnterFrame(event:Event):void {
eBtn.x = stage.stageWidth/2;
eBtn.y = 350;
}
private function onClickenterBtn(event:MouseEvent):void {
trace("enter button clicked");
fadeTween = new Tween(eBtn,"alpha",Strong.easeOut,1,0,3,true);
fadeTween.addEventListener(TweenEvent.MOTION_FINISH,remove_eBtn);
ldr.x = stage.stageWidth/2;
ldr.y = stage.stageHeight/2;
}
private function remove_eBtn(event:TweenEvent):void {
removeChild(eBtn);
addEventListener(Event.ENTER_FRAME, loading);
addChild(ldr);
}
private function loading(event:Event):void {
var bytestotal = stage.loaderInfo.bytesTotal;
var bytesloaded = stage.loaderInfo.bytesLoaded;
var percentage = Math.round(bytesloaded/bytestotal*100);
trace(percentage);
ldr.gotoAndPlay(percentage);
loader.load(new URLRequest("main.swf"));
if (bytesloaded >= bytestotal) {
removeEventListener(Event.ENTER_FRAME, loading);
removeChild(ldr);
}
}
}
}
the animation pops up then straight back out before anything happens?
thanks for looking...
Animation Not Working On IE
My Flash animation works on Firefox, Opera, Safari, and other web browsers. However, on Internet Expolorer the animation get stuck on the first frame. Is there a correct way to publish my flash settings so that it works on all browsers?
Button Animation Not Working
just hoping that you can help me out, in this fla ive tried having the buttons work where you can see the ROs and the animated button, and all work except for the first, mainly because i have made it into a movie clip in order for the answer to be displayed when clicked. the actions layer shows this. within the movie clip the there is the 1st button with the ROs extra enabled but doesnt show on screen. do you have any idea why this is happening?
what i wanted was the first button to be animated and and when clicked it displays the animation but also the word "yup" when they click the first button. but that the moment the first button onlydisplays yup and sounds but does not show the Rollover button effects and animation.
--- also i was wanting this to be a quiz style whereby the user clicks the first key and gets "yup" displayed and if they click a different one they get a "no" and have to click the first key, once they do that they have to select the second button (so in otherwords i want it to be like in the format of one question after another (selecting the right key before moving on) but am struggling with how i should do this.
if anyone can help me id really appreciate it. i could also provide the fla
Animation Sample Not Working
Hello! I am posting here instead of Flex forum because this app is no really Flex related but just Flash animation in AS3 and I just happen to be using a Flex app to display my animation so I hope someone can point me in the right direction.
Here is the MXML where I have my stage canvas:
AnimationTest1.mxml
Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
creationComplete="initApplication();">
<mx:Script source="Main.as"/>
<mx:Canvas id="animationStage">
</mx:Canvas>
</mx:Application>
Main.as
ActionScript Code:
import animation.*;
import mx.controls.Alert;
import mx.core.UIComponent;
public function initApplication():void
{
// create a new sprite object
var firstAnimation:FirstAnimation = new FirstAnimation();
// need to create a UI wrapper to be able to add the sprite to the canvas
var uiWrapper:UIComponent = new UIComponent();
uiWrapper.addChild(firstAnimation);
// add the child
animationStage.addChild(uiWrapper);
}
FirstAnimation.as:
ActionScript Code:
package animation
{
import flash.display.Sprite;
import flash.events.Event;
//import flash.display.StageAlign;
//import flash.display.StageScaleMode;
public class FirstAnimation extends Sprite
{
private var ball:Sprite;
public function FirstAnimation()
{
init();
}
private function init():void
{
//stage.scaleMode = StageScaleMode.NO_SCALE;
//stage.align = StageAlign.TOP_LEFT;
ball = new Sprite();
addChild(ball);
ball.graphics.beginFill(0xff0000);
ball.graphics.drawCircle(0, 0, 40);
ball.graphics.endFill();
ball.x = 20;
ball.y = stage.stageHeight/2;
ball.addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
}
private function onEnterFrameHandler():void
{
ball.x++;
}
}
}
If I change the following code as shown the circle appears:
ActionScript Code:
ball.graphics.beginFill(0xff0000);
ball.graphics.drawCircle(0, 0, 40);
ball.graphics.endFill();
ball.x = 100;
ball.y = 100
//ball.y = stage.stageHeight/2;
ball.addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
However the animation still doesn't take effect - HOW do I trigger the 'ENTER_FRAME' event when creating an animation from a Flex app?
So I'm pretty much teaching myself AS3 animation in Flash with the book Actionscript 3.0 Animation - Making Things Move BUT this sample isn't working. What am I doing wrong???
Thanks!
Animation Not Working In Scene 2
Hi,
I'm new to flash and i am trying to build a simple web page.
I have a web page that has a title which is a animated symbol. All that happens is a spotlight runs through the title. I also have a button which when i press i goto the next scene. In this next scene i want the title to remain at the top of the screen and the animation to occur again. However, in scene 2 the animation in the title dosen't work. The instance of the title is called travel_title and i have this command in the first frame of scene 2
this.travel_title.gotoAndPlay(1);
but it still dosen't work.
what might be the problem here?
thanks for your help
Movie Animation Not Working
Can someone please help me! I have a movie clip. When I go into the movie clip the animation works. When I put the movie clip on my main page, the movie doesn't run?!? Any ideas would be greatly appreciated. If you need to see the file it can be d/l'ed at www.keystothevip.com/notworking.zip
Thanks!
Buttons-Down Frame Animation Not Working
I have a button in my flash menu, and on the down state of the button, the animation i have for it doesnt play from beginning to end when you click and release (like a normal left click), the only way to see the whole animation, you have to click and hold. Can anyone tell me how i would make the animation play all the way through even after the the button is released?
~Thanks!
Rollover, Not Working Flip Animation
Hi all, I was wondering if someone more advanced with code can tell me exactly why my buttons are not functioning properly when I rollover them. The main code is on the main timeline of the movie to control the rollover state of the button mc. Its a simple flip animation.
Flash Version 8
Animation Not Working Whern Published
I have a button that animates.
When I enable simple buttons the animation works but when I publish it it doesn't. Any wise members know of a cause for this?
Animation Quit Working With New Player
I made a cartoon face that the mouth moves when you speak into the microphone. I made it with MX. When I revisited it with flash 8 it dosen't work. There is a movie called mouth(has stop in 1st frame) inside the object called head on the root timeline.
When I open the animation the mouth plays all the time, even with no microphone. Here is my code that is on the 1st frame of the root timeline...
Code:
var active_mic:Microphone = Microphone.get();
_root.head.mouth.attachAudio(active_mic);
_root.head.mouth.onEnterFrame = function() {
var level = active_mic.activityLevel;
if (level>=60) {
_root.head.mouth.play();
}
else{stop();
}
};
Can anyone help me....thanx wo
Preloader Starting At 82% And Another Preloader Not Working
i have two new problems now , my global preloader is starting at 82% , i do imagine why but not sure, i suposse that all my MC are been loaded at 1st frame althouth my movie starts at 5th frame in scene 2 ... is there any way to tell MCs to load at 5th frame ?
and another preloader working when i use Crtl+enter But not working at the web when i upload it into internet, here is the code of the preloader (the second one)Code:
function fotografia(numero, texto) {
_root.MCInstalaciones.ventanita.fotoin.createEmptyMovieClip('holder', 1);
//load the external movie into the new movieclip
_root.MCInstalaciones.ventanita.fotoin.holder.loadMovie('imagenes/'+numero+'.jpg');
_root.MCInstalaciones.ventanita.notainsta.textodefoto.text = texto;
};
//check the download status of the external
//movie once every frame
_root.MCInstalaciones.ventanita.fotoin.onEnterFrame = function() {
//trace the porcentajeage of the movie that has loaded
porcentaje = (_root.MCInstalaciones.ventanita.fotoin.holder.getBytesLoaded()/_root.MCInstalaciones.ventanita.fotoin.holder.getBytesTotal())*100;
if (!isNan(porcentaje)) {
_root.MCInstalaciones.ventanita.porcent.text = porcentaje;
} else {
_root.MCInstalaciones.ventanita.porcent.text = porcentaje;
}
if (porcentaje == 100) {
delete _root.MCInstalaciones.ventanita.fotoin.onEnterFrame;
}
}; this code is called when mouse moves over and now that i write this i am getting an idea why is not working......maybe this code only executes once , a single time, due to that is called from a mouseover event? if so why does it work when i do crtl+enter
could that be the cause?
Here is the link to my temporarely work where preloaders fail to do their job http://sultanos.shinranet.com/pupito.html
second preloader is to load images at INSTALACIONES link
Growing Text Animation Not Working Properly
I am using flash 8 on a pc. I am trying to get text to grow tall from an almost flat line up to full standing text. I converted the text to a symbol, then moved the center circle in the symbol down ( can't remember what that thing is called), added another keyframe ten or so frames ahead, flattened the text vertically in the first keyframe and did a motion tween. It looks right when I preview within flash but once I publish it strange things happen. First it behaved as if I had scaled the text proportionately so it just grew from small to large. I made various changes to the tween settings and it really got strange moving up and then back down.
Does anybody have any suggestions how I can accomplish this.
Thanks!
Advice/tutorials/suggestions For Working With Music And Animation
I was wondering if there were any good tutorials on making music videos on working with music and animations and synching and doing effects via actionscript and so on.. I did one tutorial which was the most common..
http://www.kennybellew.com/
It covered the basics of creating and working with music but it's still really hard to work with animations and the music at the same time without switching back and forth and A LOT of testing.. Even if there aren't any tutorials i'd appreciate some tips or advice experienced users might have... I'm sure others could also benefit from this thread if we get more comments and suggestions...
HElp Wit Preloader And Animation
Hi I was wondering how to make a simple preloader like a bar with the fill effect and then after it is done loading the bar dissapears and up pops a button that says play.
Also
I am used to SWish so i am going to ask the simplest question how do u make stuff move! not with motion tweening but frame by frame thank you oh and i am using flash MX
Preloader Animation...
So many sites have an actual animation playing whilst the loading bar does its thing.
I once tried this, but the brief animation didn't play until the preloader was done! -- In other words, it didn't loop over & over the entire time, only played one time, after site was loaded. (which wasn't very effective)
How can I get it to play as the site is actually loading?
Thanks!
50k Ok For Preloader Animation?
I have a intro to my Flash site in two parts. The 1st part is 50k, the second considerably larger. I was thinking I might get away with having the 1st part run during the preloader as an animation, but I do not know if 50k is too big a sized animation for a preloader (which means I'd have to preload the preloader). Anyone know? Of course I am aiming at 56K modem users.
Also if I am loading up multiple .swf into my movie (sound, gif animation, etc.) does a preloader preload the swfs as well? Meaning if I have load movie actions for 3 different swfs at frame 50, 100, 150 then if I set the preloader to preload up to frame 200 that the preloader will preload all are part of the swfs.
Uhh..yeah...Because I herd the best way to present a flash movie is to break everything down into smaller movies and just load one after another (so while the viewer is preoccupied with one .swf another is meanwhile loading up). I am trying to keep actual dead waiting time down to a minimum, so if I can entertain till next part of the movie is ready that be swell.
Cheers!
Holiday
Preloader With Animation
I'm using flash mx professional and actionscript 2
I've been trying to get this preloader working, it does its job, but I want this animation to play while its loading. The thing is, I want flash to look at the total frames, and only show each frame depending on how much of the file is loaded in.
I.e., if i have have the file loaded, it'll have played to the frame of the movie in the middle
This is the code I have on the first frame
stop();
myInterval = setInterval(preloader, 10);
function preloader() {
if (getBytesLoaded()>=getBytesTotal()) {
play();
clearInterval(myInterval);
}
myMovieClip.gotoAndStop(Math.round(_framesloaded/_totalframes*(myMovieClip._totalframes)));
}
The names of the my clips are correct, but I must have set something up wrong.
I also put a stop command on the first frame inside my movie clip to stop it from playing right away.
If anyone can help please do
thanks for your time
Jesse D
Preloader ANIMATION
Hi,
Can anyone please show me with an example how to do the folowing Preloader animation on the below site:
www.gotee.com
I have tried many times, but still cant do it.
Thanks and God Bless
Mr Mono
How To Use An Animation As A Preloader ? Pls Help
Hi ! I found something very nice on this website, an animated tree designed by John Wehr (you can look it up). The tree grows randomly. Different every time. I tried to use that animation as first scene, as preloader, but seems that I can't include it in the movie. Gives me errors every time. Maybe is because I'm using Flash MX and the animation was designed in Flash 5?Doesit has anything to do with that ?
I would apreciate any help ! Thank you !
How To Use An Animation As A Preloader ? Pls Help
Hi ! I found something very nice on this website, an animated tree designed by John Wehr (you can look it up). The tree grows randomly. Different every time. I tried to use that animation as first scene, as preloader, but seems that I can't include it in the movie. Gives me errors every time. Maybe is because I'm using Flash MX and the animation was designed in Flash 5?Doesit has anything to do with that ?
I would apreciate any help ! Thank you !
Animation As Preloader
I have used a basic % preloader for a site that I made
http://www.mossdesign.co.za/
The client wants a new preloader using an animation I did of a pattern fading in to form a whole pattern from one element. I attached the file. Now he wants this animation to play as the sites loads. Is there away I can control the speed of the animation so it grows as fast as the website loads? because I dont want the animation to loop as other preloaders have. But for it to work as a normal percentage bar preloader except the bar isnt shown just the animation. So is there a way? Hope I make sense
Animation For Preloader
Can I make this type of movement with AS?
I must use this animation (see file) for the preload but its a bit heavy.
And if it is actually possible will it be saving Ks?
Thanx you ever so much
fv
Preloader Animation
Im trying to make a preloader in flash for a crappy animation that I am doing, and I have the loading part done, but im trying to make an object spin around in a circle, and how much it spins depends on how much of the movie has loaded. You will know what I mean if you look at this picture:
http://img172.echo.cx/img172/5963/preloader3ow.jpg
If you know what im talking about, anyone know how to do this? I barely know actionscript
Preloader Animation
Hi - On the main blank stage I'm loading the "master.swf" which contains all the navigation GUI. As a preloader visual I have a movie clip ("loaderani_mc" ) which is a simple timeline tween. I'd like this animation to move in coordination with the numbers being displayed in loading_txt , so that when the numbers reach 100% the animation will be completed. Simple right?
When I test the movie I see the numbers progress nicely but I can't get the loaderani to play along.
Would someone please help me to make this thing work?
TIA your assistance.
JL
Attach Code
var mcLoader:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();
listener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
loading_txt.text = "Preloading " + Math.floor(bytesLoaded / bytesTotal * 100) + "%";
//eagle loader animation
this.loaderani_mc.gotoAndStop(percentage+1);
}
listener.onLoadInit = function(target:MovieClip):Void {
}
mcLoader.addListener(listener);
mcLoader.loadClip("master.swf", 1);
Preloader Animation?
This may seem like a really stupid question to ask, but how do you just have a simple animation as a preloader (and maybe even a nice pixel preloader...)?
Also, another easy to solve question, how do you get your preloader to disappear after the swf has loaded?
Preloader Animation Help
I dont know how to make my preloader animation work right. The animation is going, but it just keeps going. i would like to know how to make the animation fill the logo as it loads to 100% in sync with bytes loaded. can anyone help me?
... Animation Preloader
Can you point in the right direction on how to do an animation (which is the part where loader is loading), but when the animation completes, the movie is ready to go (it's loaded).
For instance, I want to cursive writing to say "loading" and when it's finally loaded the whole word will be spelled out.
Somebody have a tutorial on this?
Animation On A Preloader
I have a question about a different kind of preloader:
IŽd like to make a preloader with an animation instead of a loadbar simply.
I made a MC with an animation and this should play more as the main movie is completely loaded. Like steps of a person on a stair. Each step is a 10% completed loaded part of the main movie.
Thanks of any help...
Preloader Animation?
This may seem like a really stupid question to ask, but how do you just have a simple animation as a preloader (and maybe even a nice pixel preloader...)?
Also, another easy to solve question, how do you get your preloader to disappear after the swf has loaded?
|