Scrolling Image Autostart? Code Included...Please Help
I am trying to make an image scroll from top to bottom. As ur mouse goes over it, you can scroll it back up or down. It stops at the top and bottom. But I can't get it to have a default scrolling speed and direction for when there is no mouse on it. Here is the code I have on the movie clip! Thanks!
onClipEvent (load) { ycenter=150; speed=1/30; } onClipEvent (enterFrame) { var distance=_root._ymouse-ycenter; _y+=(distance*speed); if (_y > 800) _y=800; if (_y < -535) _y=-535; }
The if statements stop it at the top and bottom. I still need those to work after we get it to start scrolling. I need it to act as if the mouse is already at the top of the .swf file. Thank you!
-L
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 12-13-2005, 11:28 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Looking For The Code To Create A Mac AutoStart?
I have a hqx file that I am trying to create a AutoStart program for. I know how to create the AutoRun for PC, just a little hung up on the Mac version any help would be greatly appreciated. Thanks
Help With Image Scrolling Code
I found this code and would like to modify it so that the mouse is only active in a zone that is controlled both in the x and y direction. The code currently scrolls the images whenever I mouse into the zone, the zone however is the the full height of the movie between an area starting at x,230 and ending at x,430. How can I specify a "y" coordinate? I want to specify a specific active region that like 200 pixels square or something like that. Does that make sense?
Code:
//this code is for constant mouse drag
onClipEvent(load){
low = 230;
high = 430;
}
onClipEvent(enterFrame){
gotoAndStop(Math.ceil(_totalframes*(Math.min(Math.max(low,_root._xmouse),high-1)-low+1)/(high-low)));
}
Scrolling Text Included Images
i have to put a lots of "text" and "screen shots" copied from Ms word to flash demo
plz can any one help me.
plz if possible send the .fla file as i am new to this
it should look like a word document
What's Wrong? Code Included
What is wrong with the following :
function GetAppArea_Result(result) {
// result is a 2-dim array
var arraylength = result.length;
//result[0][0] contains a string for example "Food"
var MainAppArea = result[0][0];
//ListBoxToFill will contain a string being the name of the listbox-//component in which to fill the rest of the data from result
// a trace maessage shows that ListBoxToFill contains the string:
// MainAppAreaListBoxFood
var ListBoxToFill = "MainAppAreaListBox" + MainAppArea;
for (i=1;i<arraylength; i++) {
//The following line should add the data to the listboxcomponent bud..
// it doesn't !!! However if I would replace:[ListBoxToFill] with ea.:
// MainAppAreaListBoxFOOD than it works
[ListBoxToFill].addItemAt(i-1,result[i][0],result[i][1]);
}
}
The problem is somewhere in the correct use of brackets,point-notation in the additem command in the last line.
Question is, what is wrong?
Two Questions.. Code Included..
1. why in the world is
ActionScript Code:
stage.scaleMode = StageScaleMode.NO_SCALE;
not working.. the stage align right above it works fine.. ??? but as soon as I uncomment it, it errors out when played.
2. I'm trying to determine what needs to be added to an "ADDED_TO_STAGE" function in order to use a preloader swf.. i've got the preloader working, but i know that it's throwing a null because of a null object reference.. usually stage right?? well I've tried a bunch of different things and it's just not happening.. any suggestions..
code:
ActionScript Code:
package
{
import com.boostworthy.animation.easing.Transitions;
import com.boostworthy.animation.management.AnimationManager;
import com.boostworthy.animation.rendering.RenderMethod;
import com.boostworthy.core.Global;
import flash.display.Loader;
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.events.ProgressEvent;
import flash.filters.GlowFilter;
import flash.net.URLRequest;
import flash.ui.ContextMenu;
import flash.ui.ContextMenuItem;
public class Atoll extends MovieClip
{
//URL Requests
//______________________________________________________________________________________
var _intro:URLRequest = new URLRequest('Intro.swf')
//Variables
//______________________________________________________________________________________
//IDE item Vars
var _fullScreen:fullScreenButton = new fullScreenButton();
//Animation Vars
var _animationMNGR:AnimationManager;
//Menu Vars
var _atollMenu:ContextMenu = new ContextMenu();
var newMenuText1:ContextMenuItem = new ContextMenuItem("test");
var newMenuText2:ContextMenuItem = new ContextMenuItem("©");
//Loader Vars
var _bgSWFholder:MovieClip = new MovieClip();
//Loaders
var _mainLoader:Loader = new Loader();
//PreLoader Vars
//CONSTRUCTOR***************************************************************************
public function Atoll()
{
trace("Document Class Works");
this.addEventListener(Event.ADDED_TO_STAGE, init);
function init(event:Event):void
{
trace('added to stage')
}
//Animation Manager
_animationMNGR = new AnimationManager;
//Fullscreen
_fullScreen.buttonMode = true;
_fullScreen.addEventListener(MouseEvent.MOUSE_UP, toggleFullscreen);
_fullScreen.addEventListener(MouseEvent.MOUSE_OVER, fullScreenOver);
_fullScreen.addEventListener(MouseEvent.MOUSE_OUT, fullScreenOut);
_fullScreen.filters = [new GlowFilter(0xffffff, 1, 0, 0, 1, 1)];
_fullScreen.x = stage.stageWidth/2;
_fullScreen.y = stage.stageHeight/2;
//_fullScreen.alpha = .5;
addChild(_fullScreen);
//Contextual Menu
//______________________________________________________________________________________
this.contextMenu = _atollMenu;
_atollMenu.hideBuiltInItems();
_atollMenu.customItems.push(newMenuText1);
_atollMenu.customItems.push(newMenuText2);
//BG MovieClip Loader and Holder
//______________________________________________________________________________________
_mainLoader.load(_intro);
_mainLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, mainLoaderLoaded);
_mainLoader.contentLoaderInfo.addEventListener(Event.ACTIVATE, mainLoaderActivated);
_mainLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, mainLoaderProgress);
//Scaling stage RESIZE
Global.stage = stage;
stage.align = "TL";
//stage.scaleMode = StageScaleMode.NO_SCALE;
this.stage.addEventListener(Event.RESIZE, resizeListener);
function resizeListener(event:Event):void
{
reposition();
}
reposition();
//END OF CONSTRUCTOR
}
function reposition():void
{
/*middleClip.x = stage.stageWidth/2;
middleClip.y = stage.stageHeight/2;
topClip.width = stage.stageWidth;
topClip.y = 0;
topClip.x = 0;
botClip.width = stage.stageWidth;
botClip.x = 0;
botClip.y = stage.stageHeight - topClip.height;*/
trace("stage width: "+stage.stageWidth);
trace("stage height: "+stage.stageHeight);
if (stage.stageHeight > _bgSWFholder.height || stage.stageWidth < _bgSWFholder.width)
{
_bgSWFholder.height = stage.stageHeight;
_bgSWFholder.scaleX = _bgSWFholder.scaleY;
}
if (stage.stageWidth > _bgSWFholder.width || stage.stageHeight < _bgSWFholder.height)
{
_bgSWFholder.width = stage.stageWidth;
_bgSWFholder.scaleY = _bgSWFholder.scaleX;
}
_animationMNGR.move(_fullScreen, stage.stageWidth/2, stage.stageHeight/2, 500, Transitions.QUART_IN_AND_OUT, RenderMethod.ENTER_FRAME);
//_animationMNGR.alpha(_fullScreen, .25, 1000,Transitions.EXPO_OUT, RenderMethod.ENTER_FRAME);
//_animationMNGR.alpha(_fullScreen, 1, 2000, Transitions.EXPO_IN, RenderMethod.ENTER_FRAME);
//_animationMNGR.pulse(_fullScreen, "alpha",.25, .75, 5000, RenderMethod.ENTER_FRAME);
//_animationMNGR.pulse(_fullScreen.colorMatrix, "brightness", 0, 90,5000,RenderMethod.ENTER_FRAME);
//_animationMNGR.pulse(_fullScreen.glowFilter, "BlurX", 0, 500, 5000, RenderMethod.ENTER_FRAME);
}
//MainLoader Event FUNCTIONS
function mainLoaderProgress(evt:ProgressEvent):void
{
var _percentLoaded:Number = evt.bytesLoaded/evt.bytesTotal;
_percentLoaded = Math.round(_percentLoaded * 100);
trace(_percentLoaded);
}
function mainLoaderLoaded(evt:Event):void
{
trace('Load Complete');
_bgSWFholder = evt.target.content;
addChildAt(_bgSWFholder, 0);
reposition();
}
function mainLoaderActivated(evt:Event):void
{
trace('activated');
}
//Fullscreen Button FUNCTIONS
function fullScreenOver(evtObj:MouseEvent)
{
trace('full screen over');
_animationMNGR.filter(_fullScreen, GlowFilter, "blurX", 13, 500, Transitions.CUBIC_OUT, RenderMethod.TIMER);
_animationMNGR.filter(_fullScreen, GlowFilter, "blurY", 13, 500, Transitions.CUBIC_OUT, RenderMethod.TIMER);
_animationMNGR.brightness(_fullScreen, 100, 500, Transitions.QUART_IN_AND_OUT, RenderMethod.ENTER_FRAME);
_animationMNGR.move(_fullScreen, _fullScreen.x+1, _fullScreen.y+1, 250, Transitions.EXPO_IN_AND_OUT, RenderMethod.ENTER_FRAME);
}
function fullScreenOut(evtObj:MouseEvent)
{
trace('fullscreen out');
_animationMNGR.filter(_fullScreen, GlowFilter, "blurY", 0, 500, Transitions.CUBIC_OUT, RenderMethod.TIMER);
_animationMNGR.filter(_fullScreen, GlowFilter, "blurX", 0, 500, Transitions.CUBIC_OUT, RenderMethod.TIMER);
_animationMNGR.brightness(_fullScreen, 0, 500, Transitions.QUART_IN_AND_OUT, RenderMethod.ENTER_FRAME);
_animationMNGR.move(_fullScreen, _fullScreen.x-1, _fullScreen.y-1, 250, Transitions.EXPO_IN_AND_OUT, RenderMethod.ENTER_FRAME);
}
function toggleFullscreen(evtObj:MouseEvent)
{
switch (stage.displayState)
{
case "normal" :
stage.displayState = "fullscreen";
break;
case "fullScreen" :
default :
stage.displayState = "normal";
break;
}
trace("Toggle Fullscreen");
}
}
}
I know this is probably horrible coding, so any advice would be greatly appreciated.. thanks
A Lot Of Code And Included Files
I have a movieclip named ready, that onRelease I want some files to be included.
If the included files have a lot of code it doesn´t work, the button becomes inactive.
if the first included file has a lot of code and the counter=2 it doesn´t work. I assumed that the included files could have a lot of code because only one option is possible at time. I mean if counter=2, the option counter=1 is of no interest and it shouldn´t matter how much code counter1.as has.
Code:
ready.onRelease = function(){
if (counter==1 ){
#include "counter1.as"
}else if (counter==2 ){
#include "counter2.as"
}
}
First I tried to have all code in one frame without any included files but when that didn´t work I tried with the included files, now when that doesn´t work either, what to do if you have much code???
I have worked with this for a week now.
Help With Actionscript - Code Included
This flash gallery is wonderful, however, since I do not know actionscript I need some assistance figuring out where to implement the order in which the pictures are loaded. This code views everything in the images and thumbs directory and loads it. 1, 2, 3, 4, (.jpg).
The more pictures we add to the directory, the higher we make the number of the jpg. (51.jpg, 52.jpg, 53.jpg, etc) the number grows. How do we make it so all new images are loaded FIRST on the left and not on the right? I have attached the fla.
Help With Actionscript - Code Included
This flash gallery is wonderful, however, since I do not know actionscript I need some assistance figuring out where to implement the order in which the pictures are loaded. This code views everything in the images and thumbs directory and loads it. 1, 2, 3, 4, (.jpg).
The more pictures we add to the directory, the higher we make the number of the jpg. (51.jpg, 52.jpg, 53.jpg, etc) the number grows. How do we make it so all new images are loaded FIRST on the left and not on the right? I have attached the fla.
Can Someone Help Me Figure This Out? (code Included)
I am building a Trivial Pursuit type game, basically just to see if I can, and because trying to things like this is how I learn. I know Flash and no programming, I use it with a web design & graphics design background, mainly for graphics, but I want to learn to use it for more. My husband who is helping me knows programming (anything for any flavor of UNIX, PHP, C++, you name it) but knows NOTHING about Flash or Actionsript. So our problem is one of - he has to try and find the code specifics to make a variable global, and I don't even know what that means, but I can describe what I want.
Problem: In frame 1 the user drags their game piece onto the board, and selects the corresponding trivia category, which takes them to another frame to get the question, then another frame to get the answer, then finally back to the first frame so the next player can roll & go. When the user returns to frame 1, the game piece is back where it started, not where it was dragged to. I would like to figure out how to make the game piece "remember" where it last was, and when going back to frame 1, return to the coordinates it was most recently dragged to, so the game can be "ongoing" and people don't have to try & remember where they were.
The code: "dragMe_GamePiece_Orange" (contains dragBut_GamePiece_Orange) is the game piece symbol we used for testing purposes, which is why the code for it will look different than the code for the other colors. My husband added some trace stuff that indicates things are working, but being prevented from "being called" or something.
The "Background" layer contains this code in FRAME 1 - the first part is what we've done for the questions, and it works great. The second part is for the game pieces:
_global.run_once=0;
if(!_global.blue)
{
_global.blue=2;
_global.green=7;
_global.orange=12;
_global.red=17;
_global.yellow=22;
_global.pink=27;
_global.question=1;
if(_global.run_once=0){
_global.dragMe_GamePiece_Orange_x=503.2;
_global.dragMe_GamePiece_Orange_y=65.0;
_global.dragMe_GamePiece_Blue_x=548.6;
_global.dragMe_GamePiece_Blue_y=65.8;
_global.dragMe_GamePiece_Pink_x=595.4;
_global.dragMe_GamePiece_Pink_y=65.3;
_global.dragMe_GamePiece_Yellow_x=552.4;
_global.dragMe_GamePiece_Yellow_y=108.7;
_global.dragMe_GamePiece_Green_x=596.3;
_global.dragMe_GamePiece_Green_y=112.2;
_global.dragMe_GamePiece_Red_x=597.5;
_global.dragMe_GamePiece_Red_y=158.7;
_global.run_once=1;
}
}
stop();
The orange game piece in FRAME 1 (in the "Pies" layer)contains this code:
on (press) {
startDrag (_root.butGamePieceOrange);
}
on (release) {
stopDrag ();
_global.dragMe_GamePiece_Orange_y=getProperty(_root.dragMe_GamePiece_Orange,_y);
_global.dragMe_GamePiece_Orange_x=getProperty(_root.dragMe_GamePiece_Orange,_x);
}
In the "Dice" layer, the button for the dice (works fine) contains this code:
on (release) {
trace(_global.dragMe_GamePiece_Orange_x);
frame = Number(random(6))+1;
tellTarget ("/left") {
gotoAndStop(/:frame);
setProperty("", _rotation, random(360));
}
}
The "Pies" layer (containing all the game piece movie clips) contains this code in FRAME 1:
setProperty("_root.dragMe_GamePiece_Orange",_y,_global.dragMe_GamePiece_Orange_y);
setProperty("_root.dragMe_GamePiece_Orange",_x,_global.dragMe_GamePiece_Orange_x);
Can someone please help a non-programmer who knows Flash WYSIWYG, and a strong programmer who known no Flash figure out what we've done wrong?
If anyone would be willing, I can also e-mail the .fla file.
Password Problem (code Included)
i have a game where you enter a password and you go to the right frame and i put this code on teh submit button
--------------------------------
on (release) {
if (passlogin == "dodo") {
gotoAndPlay(10);
} else {
gotoAndPlay(3);
}
}
---------------------------------
now as you can see the instance name of the text box to enter the password is passlogin but when i enter dodo it takes me to teh 3rd frame. can any1 help?
Random Not Working(code Included)
Code:
onClipEvent (enterFrame) {
m = random(4)
if(m=1){
this_x+=6}
if(m=2){
this_y+=6}
if(m=3){
this_x-=6}
if(m=4){
this_y-= 6}
trace(m)
}
thats my code. the trace is only to make sure i get a variety. I only get four, though. I don't know whats wrong.
Problem With Calendar (code Included)
Hello there! I'm new to Flash programming, and got an university project that includes a working calendar. I've got some stuff working, had to copy and migrate some code from some random actionscript 2.0 sources ( couldn't find any calendar help for 3.0 : ).
Anyway, here it goes:
Code:
function createTextField(x:Number, y:Number, width:Number, height:Number):TextField {
var result:TextField = new TextField();
result.text = "" + helper.dayValue;
result.x = x;
result.y = y;
result.width = width;
result.height = height;
result.type = TextFieldType.DYNAMIC;
result.defaultTextFormat = format;
result.backgroundColor = 0x666666;
result.border = true;
result.textColor = 0x000000;
//assinala a Data actual ( não parece funcionar)
var now:Date = new Date();
if((now.getFullYear()==currentYear)&&(now.getMonth()==currentMonth)&&(now.getDate()==helper.dayValue)){
result.alpha = 50;
}
addChild(result);
return result;
}
function loading(){
var zeroDate:Date = new Date((currentYear),currentMonth,1);//cria um novo objecto Date
var zeroDay:Number= zeroDate.getDay();//busca o dia
if (zeroDay==0){zeroDay=7;}//fazer do domingo o sétimo dia
var increment:Number = zeroDay-1;//incremento é igual ao nº de dias passado desde o 1º
var numberOfDays:Number = numDays[currentMonth]+2;//calcula o nº de dias no mês actual
//trace (numberOfDays);
var xpos:Number = 200 + 26*increment;//a posição x inicial. 26 é a largura da caixa
var ypos:Number = 90;//posição y inicial
//chama a função principal
drawDays(zeroDay,numberOfDays,xpos,ypos);
}
function drawDays(zeroDay,numberOfDays,xpos,ypos){
for(i=zeroDay-1; i<zeroDay+numberOfDays-3; i++){
//escreve uma nova linha quando deve
if ((i==7)||(i==14)||(i==21)||(i==28)||(i==35)){
xpos = xpos-182;
ypos = ypos+20;
}
createTextField(xpos, ypos, 26, 20)
xpos = xpos+26;//incrementa a posição para o próximo
helper.dayValue ++;//incrementa o dia
}
}
loading();
stop();
Sorry about the portuguese comments, just nvm them :P
The problem is that Flash just "freezes" after drawing all the days' textboxes. I don't even know what's wrong because the built in debugger kinda freezes as well.
Any ideas / suggestions on how to make this work, or on what to change to make it a better calendar?
Any help is appreciated, if needed i can supply full code.
PS: All my code is written in the timeline, I don't have any external files.
HELP I'm Confused And Dunno What I Did Wrong (code Included)
hi i am making this game and i have a MC (fish) and a door. when i click a button on a door it should make the fish varible play the next frame which makes the door play the next frame.
on (release) {
fish.nextFrame();
}
that is on the door. and should make the fish play teh next frame.
door.nextFrame();
this is on the frame that teh fish should go to. and it should make the door play the next frame. but it doesn't. both the door and teh fish have stop (); on the frame they are on. but i dont think this would make a difference as it tells the MC's to play next frame. it doesn't work shat can i do?
Removing MC Problem(Code Included This Time)
I want to remove a MC from the stage. I've tried several different methods but it throws error codes. Any ideas? Thanks
electronic.visible = false;
hiphop.visible = false;
pop.visible = false;
alternative.visible = false;
classical.visible = false;
butt.addEventListener(MouseEvent.CLICK, butt1);
function butt1(event:MouseEvent):void {
if (electronic.visible == false) {
electronic.visible = true;
}else if (electronic.visible == true) {
hiphop.visible = true;
//here is where I'm having the problem
this.parent.removeChild(electronic);
}else if (hiphop.visible == true) {
pop.visible = true;
hiphop.visible = false;
}
}
When I run it and I get to that "else if" it throws the following error:
"Error #2025: The supplied DisplayObject must be a child of the caller."
Can't Get Remoting Working (CFMX), Code And URL Included.
I'm having a lot of problems getting flash remoting to work. I have installed the AS 1.0 remoting components and am using Ben Forta's first simple example in the book CFMX App. Const. Kit. I'm using a hosting place that
says it supports Flash Remoting. The only thing I'm unsure of is where to point to get the NetServices.as. I have asked the hosting company but they have not gotten back to me yet. I'm using an html page to deliver this.
I'm pretty certain I have everything right since I copied it directly from the book. I have created a datasource called owsdb and have created a CF datasource pointing to that database, it points to this datasource in the Application.cfc. I can not get the Simple Search function to work. I don't get any errors I just get nothing.
Here's my Actionscript, CF code, and URL.
Actionscript:
#include "NetServices.as"
// --------------------------------------------------
// Application initialization
// --------------------------------------------------
if (inited == null)
{
// do this code only once
inited = true;
// set the default gateway URL (this is used only in authoring)
NetServices.setDefaultGatewayUrl("http://hosting2.hosting-coldfusion.com/flashservices/gateway")
// connect to the gateway
gateway_conn = NetServices.createGatewayConnection();
// get a reference to a service
// In this case, the "service" is the /ows/26 directory in web server root
myService = gateway_conn.getService("ows.26", this);
}
CF code:
<!---
Filename: SimpleSearchProvider.cfm
Purpose: Provides a simple film search service for a Flash MX movie
--->
<!--- We are expecting a SearchString parameter from Flash --->
<cfparam name="FLASH.searchstring" type="string">
<!--- Query the database for any matching film records --->
<cfquery name="searchQuery" datasource="#APPLICATION.dataSource#" maxrows="1">
SELECT *
FROM Films
WHERE MovieTitle LIKE '%#FLASH.searchstring#%'
</cfquery>
<!--- Set the FLASH.Result variable to the summary of the returned film --->
<!--- This will be available as the “result” variable in the --->
<!--- SimpleSearchProvider_Result handler within the Flash movie --->
<cfset FLASH.result = searchQuery.summary>
URL:
http://hosting2.hosting-coldfusion.c...archmovie.html
Any help would be greatly appreciated as I've been trying to figure this out for a week.
Thanks,
Jason
CSS Action Script Problem... (code Snippet Included)
I've been working on a friend of mine web site and am having difficulties with the CSS. it works occasionally (dont ask me why). When I got to the site the CSS will load and other times it wont unless I refresh the page. when I use IE it flat out does'nt work. I've included the code I used. If anyone can make any suggestions on a better way to code a dynamic text field it is greatly appreciated. Check this site out and let me know if you have any problems viewing the text.
www.mahoganieunderground.com
- thanks a mil
--AS Code --
// Dynamic Text field
biography_txt.depthChild0._alpha = 0;
biography_txt.setStyle("borderStyle", "none");
biography_txt.html = true;
//laoding Headline stylesheets
var biography_css = new TextField.StyleSheet();
biography_css.load("assets/bio/biography.css");
biography_css.onLoad = function(success:Boolean) {
if (success) {
biography_txt.styleSheet = biography_css;
} else {
trace("Error loading CSS file.");
}
};
//loading top story text files
var biography_lv:LoadVars = new LoadVars();
biography_lv.load("assets/bio/biography.txt");
biography_lv.onLoad = function(success:Boolean) {
if (success) {
biography_txt.text = this.content;
} else {
trace("unable to load text file.");
}
};
[F8] Bullet Rotation Problems (Code And Screeny Included)
I am having an issue with rotation. I have a gun that fires bazooka rounds that fall to the ground after being fired. So far, they fire, slow down, and fall downward, but as soon as the bullets are pointed down they rotate all crazy and just fall straight down.
Heres my code for the bullet:
Code:
speed = 30;
function onEnterFrame() {
speed -= speed*0.02;
gravity = (30-speed);
xnum = speed*Math.sin(this._rotation*(Math.PI/180));
ynum = speed*Math.cos(this._rotation*(Math.PI/180))-gravity;
var angle:Number = Math.atan(((xnum)/(ynum)));
var shotangle:Number = (angle*180/Math.PI);
this._rotation = shotangle;
this._y -= ynum;
this._x += xnum;
}
Here is a sped up example screeny:
Click to enlarge
Thanks for any help
Text Scrolls Forever..how Do I Get It To Stop? My Code Is Included.
Hey..I have the following code for the actions of my buttons. Right now the text will scroll for days. How do I get it to stop when the text is at the top or bottom?
THANKS. vv
ActionScript Code:
//scrollUp.onRollover = function(){ //makes a loop so the movie clip will be scrolled as long as the mouse is over the button onEnterFrame = moveUp; }scrollUp.onRollOut = scrollUp.onDragOut = function(){ //ends the loop so the content stops moving when the mouse leaves the button onEnterFrame = null;}scrollDown.onRollover = function(){ onEnterFrame = moveDown;}scrollDown.onRollOut = scrollDown.onDragOut = function(){ onEnterFrame = null;}//functions called to move the content mcfunction moveUp(){ content._y -=5; updateAfterEvent();}function moveDown(){ content._y +=5; updateAfterEvent();}
[CS3] Load/Unload - Here We Go Again (image Included)
I've read various forum posts on load/unload. At this point I am not going to ask for specific code. Instead, I'll just ask a construction question for my project. I think I can work my way through code even though I am a newbie.
Question/Project
I plan a main screen with buttons. Each button would launch a video. Each video would play into this same window (where the buttons are). At the end of each video clip I need for the video to close(unload?) so the user would have access to the buttons again to play another video.
The direction I want to focus learning is putting a cue point at the end of each swf. Then I would reference this cue point with an unload action. Is that the correct direction I need to go?
As a secondary point, if the user does not want to play the loaded swf to the end where the cue point would trigger close(unload)....would I put a button into each video swf that the user could close(unload) the playing video. Basically I might have the button say "Close this video" on roll-over. Is this also the correct way to construct this.
The bottom line is how should this project be constructed?
Thanks.
Loading Of External Image Not Included In Preloader
Okay... I now know that I can load a jpg dynamically from the server at runtime using the loadMovie() method. But the loading of this image is not included in my preloader for the rest of the swf and therefore my swf movie plays before my image is loaded.
How can I include the loading of a loadMovie() in my preloader for the mainmovie?
Release Button - Image Stays (FLA Included)
I have this movie so close to working. All i need to figure out now is when you push a button, and image appears, and when you let go, it stays there.
It sounds like the simplest thing but i just can't figure it out.
I have script set to each button on the root level so that when they are pressed it pulls a bunch of links from a text file.
If you double click the buttons you can see that on the hover state it changes the button face and shows a different title.
Currently I put the unrolled map on the Down and Hit state, but when you play the movie, as soon as you press a release a pressed button the unrolled map image disappears.
If someone can please help me with this I'd appreciate it greatly, the Deadline clock for this project is well passed due.
How To Make Mouse Move Background Image - Example Included
Hey everyone,
I was wondering if anyone knows how this website was built in flash?
http://www.robyn.com/
I want to create a website like this with moving background image and buttons like the above site...
Are there any tutorials you can link me to? I have been browsing the site but can't seem to find anything for this...
thanks alot!!
James
How To Make Mouse Move Background Image - Example Included
How to make mouse move background image - example included
--------------------------------------------------------------------------------
Hey everyone,
I was wondering if anyone knows how this website was built in flash?
http://www.robyn.com/
I want to create a website like this with moving background image and buttons like the above site...
Are there any tutorials you can link me to? I have been browsing the site but can't seem to find anything for this...
thanks alot!!
[F8] Water Effect Around Girls Legs (image Included)
Hello..
I'm fine with the basics of flash, creating buttons, tweens, shapes, etc. However, I've been trying to figure out how to animate the water around this girls legs so that appears to be moving. I've searched on the forum to threads dating back to 2004, but a lot of the links/examples there are dead.
I'll be around all day today so if you have any questions, I'll try to respond as soon as possible, and by possible, I mean in a couple of minutes, unless it's night time.
Attatched is the image I want to animate. The girls legs are to be in place, but the water around her should be moving, in the direction you see the first ripples in. I've tried creating graphic symbols to move/fade around, but it looks too fake.
XML Based Horizontal Image Scroller (src Included): Some Help Needed.
Hello,
I'm currently working on an XML based horizontal image scroller. Since I'm stuck with 2 annoying problems, I decided to share the project's source, and count on the experience of others to try and help me.
As you'll see, it's running pretty good already, only 2 major problems left:
- Bug when scroller moves to the left: the images overlap, and I simply can't locate the problem.
- The tooltip: I can't seem to get it into highest layer (level), on top of everything. When tracing it's depth, it says '-16383'.
As for the rest, I still need to implement 2 remaining functionalities:
- If the sum of the images (width) is smaller than the width of the movie, the images need to be duplicated untill theirs sum's width exceeds the width of the movie.
- I'd like to add a nicer mouseOver effect.
Especially help on the 2 bugs would be greatly appreciated, the other remaining functionality I'll work out myself...
[source removed]
KeyPress Action Scrript Not Working When Trying To Press "m"... Example Code Included
So I've got my map, "mapClip", inside another movie clip named "UI." I want to go to frame two of the mapClip when the user presses "m".
I've tried using the following code, which doesnt seem to be working.
Code:
on(keyPress "m"){
_root.UI.mapClip.gotoAndStop(2);
}
Code:
onClipEvent(enterFrame){
if(keyPress(m)){
_root.UI.mapClip.gotoAndStop(2);
}
}
Help?
Blurs And Bluring In MX:Image And Text Blurs (examples Of What I Would Like Included)
How do you do the image blur (image focus) as in here....
http://www.deviantart.com/view/994057/
The part where you see the girl on the right side of the screen on the mountian edge sniping, You see the back ground is in full focus then comes out of focus to make your attention go to the girl
I know this can be done in photoshop using the blur, but he makes it blur like over 15 times, and that would need 10 seperate pictures in flash, 40kb each *15= 600kb for a 8 seconds in a movie?
------------------
And how is the Text blurs done in this:
Download this so you can see it frame by frame with
Ctrl+(right arrow) and Ctrl+(Left arrow)
http://www.deviantart.com/view/1745427/
Here are the text blurs in order and there location in the movie, if you could PLEASE recreate or tell how, BIG THANKS!
1. Okay the 1st text blur with the words Ogreisland
2. the 2nd is at where it says United Under One
3. 3rd text blur is a small one, Be the Best We can be
4. 4th text blur you cant miss it says, Transformation
5. Either by Cant miss that one either
6. Is the last one, THe word Sniper is a moving text blur
Autostart CD ROM
HI,
I wonder if anyone can help me. I've created a flash movie which I want to burn onto a cd rom. I've saved the projector file and everything, but I want it to start automatically when you insert the cd, is there a FS command or some actionscript to do this? It's for use on a mac and I am using a mac.
Thanks in advance for any help.
Autostart CD In OSX?
hi all
is there a way you can make a CD autostart a projector in OSX ????????
i can do it for OS9 in toast and PC with autorun.inf but not OSX, any help would be great
Cheers
Autostart
okay this should be easy.... i am creating a flash movie and publishing it as a projector for a mac platform... how to initial an autostart so the program automatically starts when placed in the cd rom drive....
thank you in advance
Autostart Cd-rom
I need to autostart a CD with a mac projecter file and a PC exe file on it.
I would like the relevent file to automaticly open when you insert it into the drive.
Can anyone tell me how to go about doing this?
Autostart Cd Help
how can i make a pc cd that autostarts using flash mx?
i need it to automatically starts the flash movie, and the movie will have a password script in it.
thanks sooo much for your help.
aleloop
Autostart
When someone puts a cd (my movie) into their cd drive, does anyone know how to make it autostart?
XML Autostart
Howdy I was wondering if anybody in this forums could help me auto start my videos and lead in right into the next video i've pasted the code and attached the "sample"........
Thanks Chuck
var playlistXML:XML = new XML();
playlistXML.ignoreWhite = true;
var currentVideo:String;
var currentFLV:String;
playlistXML.onLoad = function() {
var tempArray = new Array();
for (var i = 0; i<this.firstChild.childNodes.length; ++i) {
tempArray[i] = new Object();
tempArray[i].label = this.firstChild.childNodes[i].attributes.vdate+newline+this.firstChild.childNod es[i].firstChild.nodeValue;
tempArray[i].data = this.firstChild.childNodes[i].attributes.flv_url;
}
playlist_lb.dataProvider = tempArray;
};
playlistXML.load("video_list.xml");
playBut._visible = false;
pauseBut._visible = true;
playlist_lbListener = {};
var playlist_lbListener:Object = new Object();
playlist_lbListener.change = function() {
currentVideo = playlist_lb.selectedItem.label;
currentFLV = playlist_lb.selectedItem.data;
playBut._visible = false;
pauseBut._visible = true;
nc = new NetConnection();
nc.connect(null);
ns = new NetStream(nc);
ns.setBufferTime(0);
ns.onStatus = function(object) {
// rewind and pause on stop
};
// Attach the NetStream video feed to the Video object
the_video.attachVideo(ns);
// Set the buffer time
ns.setBufferTime(5);
// Begin playing the FLV file
ns.play(currentFLV);
// build sound object
this.createEmptyMovieClip("snd", 0);
snd.attachAudio(ns);
audio = new Sound(snd);
};
playlist_lb.addEventListener("change", playlist_lbListener);
CD Rom Autostart
I'm thinking about making a CD Rom with Flash and I was wondering about how to make the autostart on the CD. Is it difficult? Probably not. Can anybody tell me how?
Tx
Autostart Help
Hello all. I've been trying to learn more about sound and flash lately and have an existing mp3 player that I need help with.
I've built my own simple mp3 player so far, but this one is a bit more complicated and I'm stuck on one thing...
What needs to be added/changed so that this player will not autostart?
I have tried changing this.sound_obj.loadSound(file,true) to this.sound_obj.loadSound(file,false) but it still autostarts.
I'm still a newbie when it comes to Flash and I've tried searching on this topic for something that will answer my questions for this particular player, but no luck.
So, any help is greatly appreciated. Source code is below.
Thanks,
Opusmx
---------------
stop();
playlist = new XML();
playlist.ignoreWhite=true;
playlist.onLoad = function (success) {
if(success) {
_global.songname = [];
_global.songband = [];
_global.songfile = [];
for (var i=0; i<playlist.firstChild.childNodes.length; i++) {
_global.songname[i] = playlist.firstChild.childNodes[i].attributes.name;
_global.songband[i] = playlist.firstChild.childNodes[i].attributes.band;
_global.songfile[i] = playlist.firstChild.childNodes[i].attributes.file;
//trace(songname[i]+" "+songfile[i]+" "+songband[i]);
}
}
_root.createEmptyMovieClip("sound_mc",1);
_global.song_nr = random(songfile.length);
_root.sound_mc.songStarter(songfile[song_nr],songname[song_nr],songband[song_nr]);
}
function timer(sound_obj) {
time=sound_obj.position/1000;
min=Math.floor(time/60);
min=(min<10)?"0"+min:min;
sec=Math.floor(time%60);
sec=(sec<10)?"0"+sec:sec;
timeDisplay_txt.text=min+":"+sec;
}
MovieClip.prototype.songStarter = function (file, name, band) {
if (this.sound_obj){
this.sound_obj.stop();
delete this.sound_obj;
}
this.sound_obj = new Sound(this)
this.sound_obj.loadSound(file,true)
this.onEnterFrame = function () {
if(this.sound_obj.position>0) {
delete this.onEnterFrame;
this._parent.display_txt.text=name+" - "+band;
timeInterval = setInterval(timer, 1000, this.sound_obj);
} else {
this._parent.display_txt.text="loading..."
}
}
this.sound_obj.onSoundComplete = function () {
clearInterval(timeInterval);
this._parent.timeDisplay_txt.text="00:00";
(song_nr==songfile.length-1)? _global.song_nr=0 : _global.song_nr++;
_root.sound_mc.songStarter(songfile[song_nr],songname[song_nr],songband[song_nr]);
}
this._parent.volume1.dragger.onPress = function() {
startDrag(this, true, 0, this._y, this._parent.volBG._width, this._y);
this.onEnterFrame = function() {
var p = (this._x/this._parent.volBG._width)*100;
this._parent._parent.sound_mc.sound_obj.setVolume( p);
};
}
this._parent.volume1.dragger.onRelease = function() {
delete this.onEnterFrame;
stopDrag();
};
this._parent.volume1.dragger.onReleaseOutside = function() {
stopDrag();
};
}
btn_play.onRelease = function () {
clearInterval(timeInterval);
this._parent.timeDisplay_txt.text="00:00";
this._parent.sound_mc.songStarter(songfile[song_nr],songname[song_nr],songband[song_nr]);
}
btn_stop.onRelease = function() {
clearInterval(timeInterval);
this._parent.timeDisplay_txt.text="00:00";
this._parent.sound_mc.sound_obj.stop();
}
btn_fw.onRelease = function () {
clearInterval(timeInterval);
this._parent.timeDisplay_txt.text="00:00";
(song_nr==songfile.length-1)? _global.song_nr=0 : _global.song_nr++;
_root.sound_mc.songStarter(songfile[song_nr],songname[song_nr],songband[song_nr]);
}
btn_rev.onRelease = function () {
clearInterval(timeInterval);
this._parent.timeDisplay_txt.text="00:00";
(song_nr==0)? _global.song_nr=songfile.length-1 : _global.song_nr--;
_root.sound_mc.songStarter(songfile[song_nr],songname[song_nr],songband[song_nr])
}
playlist.load("jukebox.xml");
Anyway To Autostart From CD?
Well you know, I am making a interactive cd rom & I am looking for a way for it to start when someone inserts the cd, on mac & pc. I guess I need 1 exe file & something for mac?? If you guys have any idea or know of any software that does this please let me know. Thanks & happy holidays (love the theme)
Help With Autostart
I am a total n00bie with this so I apologize in advance for my ignorance.
I have this animation that refuses to start rotating unless I click on the animation and then hit the spacebar...
What can I do in order to get this stuff going?
Since i'm a new user the forum wont allow me to post the URL... PM if you have any ideas PLZ.
woodallcreative.com/proofs/strong/index.php
P
Image Scroller- Loaded Image Keeps On Scrolling
Hello. I am working on a client image scroller for my compaines website. What I want to do is once the user click on a specific client logo, a image pops up inside a " holder" MC. But when this happens, the image that appears scrolls along with the scroller nav bar.
My question: is there a way to make the image linked to button to stop scrolling?
Please see the attachment and click on the " DELL" button to see what I am talking about.
TIA
AUTOSTART IN MACINTOSH
AUTOSTART IN MACINTOSH
This has been put into the Newbies and Mac forum.
I read how to autostart a pc flash file.
How do I autostart a macintosh flash file?!
Autostart With Certain Program
hi there,
is it possible to create an autostart with a certain
program on a cd?
if so, how does it work?
as usual every help appreciated
Mac Autostart With Application
hi there,
my problem is to create an autorun for a cd-rom which
starts a html file with a browser.
autorun itself is working fine, unless u use os X. I think
they just skipped it, so it will work only on os 9 or earlier.
well, if i e.g. create a html file with dreamweaver, autrun will
open the html file NOT in a browser BUT in dreamweaver.
the windows autorun for the same thing works fine, if u use stuff
like runfile.exe in addition.
so does any1 have a clue, how to solve this or if there's a similar
utility for mac??
as usual every help appreciated
Autostart File For CD
How can I create a file that autostarts a flash movie called start.exe on a CD when the CD is inserted into the computer?
Thanks,
Jason
Loadmovie Must NOT Autostart. How To Do This?
Hello :-)
Maybe one of u knows the answer to this problem.
I have a swf, lets name it swf1. In swf1 a movieclip is playing. During the playing of swf1(the user is watching the movie) I load a second swf (lets name it swf2) with the ‘loadmovie’ action. I only want to do this because on the next page of my website swf2 is needed. So by ‘preloading’ it, it’s already in the browsers cache and the user doesn’t have to wait for swf2 to download when he surfs on. Now the problem. Swf2 is a movie clip with video and sound. When swf1 is playing and swf2 is fully loaded, swf2 begins playing to. I know this is the normal behaviour of AS and the loadmovie command. The result is that swf1 and swf2 are playing over each other. That’s not what I want.
1. Is it possible to give a loadmovie command the option NOT to start playing when it is loaded? When yes, how to do this?
2. If 1 is not possible, can i mute the sound of a loaded movie?
3. If 1 and 2 are not possible, are there other ways to ‘preload’ swf’s in the background (without playing them) for later use on the website?
Thanks in advance for the help.
Greetings, Luut.
Autostart For Macs (please Help)
creating a cd for co., and I was wondering if there is a code which would auostart a mac projecor file when the cd is put in the computer.
[F8] As 2.0 Video Autostart
Hello,
I have embedded a video in flash, and I do not want it to automatically start playing when the swf file loads. I want the rest of the movie to play though. Is there a way to do this ?
best,
Aaron
Want To Get FLV NOT To Autostart And NOT Loop
I clipped this code from a tutorial at gotoandlearn and am trying to figure out how to have the FLV NOT automatically start playing and once it completes, NOT loop but go back to first frame. Please help or offer suggestions. Thanks.
PHP Code:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
theVideo.attachVideo(ns);
ns.setBufferTime(10);
ns.onStatus = function(info) {
trace(info.code);
if(info.code == "NetStream.Buffer.Full") {
bufferClip._visible = false;
}
if(info.code == "NetStream.Buffer.Empty") {
bufferClip._visible = true;
}
if(info.code == "NetStream.Play.Stop") {
ns.seek(0);
}
}
ns.play("flv/#.flv");
playButt.onRelease = function() {
ns.play();
playPaus.play(1);
}
playButt.onRelease = function() {
ns.pause();
playPaus.play();
}
stopButt.onRelease = function() {
ns.seek(0);
ns.pause(true);
}
var videoInterval = setInterval(videoStatus,100);
var amountLoaded:Number;
var duration:Number;
ns["onMetaData"] = function(obj) {
duration = obj.duration;
}
function videoStatus() {
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
loader.loadbar._width = amountLoaded * 238.6;
loader.scrub._x = ns.time / duration * 238.6;
}
var scrubInterval;
loader.scrub.onPress = function() {
clearInterval(videoInterval);
scrubInterval = setInterval(scrubit,10);
this.startDrag(false,0,this._y,238,this._y);
}
loader.scrub.onRelease = loader.scrub.onReleaseOutside = function() {
clearInterval(scrubInterval);
videoInterval = setInterval(videoStatus,100);
this.stopDrag();
}
function scrubit() {
ns.seek(Math.floor((loader.scrub._x/238)*duration));
}
|