ActionScript 3.0 :: Calling MovieClips Function For Interactive Video Game?
Mar 13, 2010
i'm Currently creating an interactive video game. There are 66 movies. I'm new to AS3, and have little experience in AS2.
The game in short:
You choose from 5 ingredients, each has this product provides a number of calories:Rice R = <- for all standard!
[code].....
View 6 Replies
Similar Posts:
Mar 13, 2010
I'm Currently creating an interactive video game. There are 66 movies. I'm new to AS3 and have a little experience with AS2. I will try to explain the game! You choose from 5 ingredients, each has this product provides a number of calories:
Rice R = <- standard value!
Mais =-C
Roots =-W
Tofu =-T
Onions =-U
Champions =-M
Each ingredient can be added only 1 once.
Good combinations:
R-U-T-CR-U-C-TR-T-U-CR-T-U-CR-C-U-TR-C-T-U
Each movie is in a movie clip. And the frame where the movieclip is on, is labeled with the combination. For this I wrote the following script:
ActionScript 3 Code:
stop ();
var caloriesVar: Number = 10, / / default Rice
var inpanVar: String = "R", / / R = Rice
iLabel.info_txt.text = (caloriesVar);
iLabel.info_txt2.text = (inpanVar) / / idem
[Code] .....
But this does not work. When you click a button, the script doesn't do anything. Do not know where it goes wrong because he does not update the text fields.
View 2 Replies
Aug 13, 2010
we are doing a seamless interactive video-game-video project, but are having optimization problems. Because the client wants a full-screen option for both the video and game segments, our file size is too big. Any advice on how to minimize load time yet retain a relatively high-quality image standard? The h.264 codec would help with image quality, but there are licensing issues, and we need the transperent alpha channel for the video segments.
View 1 Replies
Feb 7, 2010
I am creating an interactive map which is attached, what I want when you hover over any movieclip the alpha decreases and when you mouse off it goes back to 100% aplha. I can certainly do this, but I only know how to do it by referencing each movieclip first! For example:
[Code].....
View 6 Replies
Oct 6, 2010
In our live chat application when C# calls our swf file. Swf loads successfully and chat start vidoe streaming is perfect. But in the mean time if any of the C# function calls their internal function(C# function) video gets stuck for that duration and play again after C# function gets data.
View 3 Replies
Aug 11, 2010
I have created animated presentations (since now, I have just videos) for my seminars at the university with cinema 4D and I added some effects with After Effects (CS5). Now, I want to build an interactive presentation. That means:
- The (video projector) presentation starts with a video in a loop.
- When I click a button on the mouse/keyboard, the video finishes the loop until the end and
- show a transition video and
- start the next loop and so on...
[Code]...
View 4 Replies
May 13, 2009
I'm looking to build a very simple (hopefully!) interactive game.
- A number of balls are situated at the bottom of the stage.
- There are several dropzones which the balls can be placed in.
-Once a dropzone is occupied with a ball, its not possible to populate that the dropzone with another ball until the present one has been removed. -Depending on which balls are present in the dropzones, the balls animate differently. the red ball is placed in a dropzone. There are currently no other dropzones populated with a ball.
[Code]...
View 5 Replies
Jul 20, 2010
my latest project is to create an interactive version of the map for the game, GTA: San Andreas. Here are some of the features I would like to add:(Images have been made as a quick demonstration - the real thing will use the map)URL...Zoomed out, selectable pieces of the map (like jigsaw pieces).The different "jigsaw" pieces of the map are based on the borderlines of where each town/village starts/ends.URL...When a region on the map is chosen, it zooms into the region, allowing the user to select a town/village within that region. This screen will have a "back" button on it to allow the user to go back to the whole map.URL...After choosing a town/village, the last screen appears, providing an image (screenshot from in-game) of the destination with information to the left or right of the image. This screen will also have a "back" button on it to allow the user to go back to the chosen region. The detail on the map will also show basic places that the player of the game would like to know, such as hospital locations, ammu-nation locations (gun shops) and safehouses.Once I have the basic version done, I plan on updating it by adding locations of other items, such as vehicles, collectables and weapons.
1) Is it possible to make oddly-shaped hotspots, which are interactable (clickable and what not)? I know you can make rectangular hotspots, but the borderlines of the towns and villages in the game aren't straight lines, and most require more than 4 lines to make the shape.
2) Is there any way I can learn the code that Flash uses? Just so I understand it a bit more, since I am using it for a two-year school project too, which goes towards my GCSEs next year. I would just like to get more familiar with Flash, and maybe the other programs, Illustrator and Fireworks. The only ones I know well are Photoshop and Dreamweaver.
View 1 Replies
Feb 1, 2009
basically i got this video i need to make interactive, where the user will be able to click on hotspots in a video as it scales -- any possible ideas or directions?
The idea i got is if i know my hotspot is initially at x:700 y:300, and the video scales, i just move it over by that much of a factor -- from what my current resolution was to my new resolution?
View 3 Replies
Jan 14, 2009
I have four movie clips on stage, I change those to buttons with onRelease script. Each movie clips have 2 frames ON and OFF when I click one of them, active other movie clip normally but my buttons don't work well. I want when I click one of them this button go to frame 2 and stop and other buttons go to frame 1 and stop.
View 3 Replies
Mar 19, 2010
I'm making an interactive kind of game, and I want a number of scenes to change once the user has looked at each once.For example, they go into three different scenes. When they finish looking at them all, Flash records this, and then when they look back at each scene again, they've all changed.
View 10 Replies
Mar 3, 2010
I am currently working on a map of the US that is interactive. My goal is to be able to mouse over the states and have them turn red and then a window with contact information will open at your mouse when clicked. I am running into a few problems. I dont know the process for creating a color tween for my movieclips. my solution was to make a copy of the states, color them red and place them behind the gray ones and attatch an event listener to all the states that lowers their alpha when moused over. thats not really the problem though. for my code that i have used to call in the window is as follows. I will use texas as an example.
[Code]...
View 5 Replies
May 21, 2007
I have a minor problem implementing an interactive photomontage section to my site. By that I mean lots of images which can be dragged about by the user to create one larger whole image. Like this (but much simpler, only 12 or so images on the stage): [URL]. So I'm putting the images inside a movieclip as I can use the startDrag and stopDrag actionscript commands so the user can drag the images around.
Here's the code I'm using on each movieclip image:
on (press) {
startDrag(this);
} on (release) {
stopDrag();
}
The problem I have is that I have two photomontages (2 set of images). The user clicks on a thumbnail in the lower right corner to select which one. Each button fades in the appropriate images, and fades out the other set - this is fine. The problem is that obviously the set of images on the highest layer (the Abbey set) are still on the stage but are just faded out (by movieclip tween alpha), so they conflict with the Statue set. Ie. when you try and click and drag an image in the Statue set, you can't get hold of them as you are really dragging the invisible Abbey set around still. I've attached a FLA file which demonstrates this problem. Click on 'BTN1' or 'BTN2' to change the set of images. The Abbey one works fine, but when trying to drag the statue one, the Abbey one if hidden on top will cause problems.
Here's what the section looks like in my project (thumbnails to select which):
Abbey images:
Statue images:
I've tried wrapping the startDrag commands inside an if statement that held a true or false, then put true or false in the appropriate places inside each image movieclip to represent when it is visible or not. I thought this would work, but it doesn't. I also tried putting the set of images at slightly different points in the main timeline, so they were never on top of each other, and then jumping to that point in the timeline when selecting the thumbnails. This kind of worked, but weirdly I had to click twice on the Statue set for them to show (fade in).
View 4 Replies
Jun 11, 2010
Im making a flash project in flash cs3 using As2.It is a large interactive game with imported external swfs throughout,Ive placed the lockroot code in all the external swfs.
When i play the external swfs on their own they play perfectly put when imported into the main.fla they don't work properly,some of the functionality doesnt work properly..As an example I have made a jigsaw game using drag n drop and targets, where the code
if(this._droptarget == "/dropTargetOne")
{
_root.dragger1.gotoAndStop("5");}
}
appears I have problems because the code _root.dragger1.gotoAndStop("5"); doesnt work when imported as an external swf.I've tried using this._parent but no success.So I think the problem is to do with using _root which I was hoping would be sorted with this._lockroot = true;
View 3 Replies
Dec 24, 2009
I have my game swf called inside a fla with loader method. The swf loaded completely, played well.Strange,when my player lost game, I mean for GameOver dialog box. It was playing well without any fault when i played my game swf individually, but when I called it inside a fla, its dialog box button is not working as usual.
View 2 Replies
Jan 4, 2010
Would it be possible to have a video (MP4, FLV, F4V, or some other popular format) contain a table of contents that the user can click to seek to different sections of the movie?
View 2 Replies
Feb 28, 2011
Any way to make a video as a transition for a flash movie? What I mean is, say you have an image of a city, and you have a bunch of clickable areas in that image. When you click on one of those areas, a video plays that would transition you from the original image to the new location, almost like a fly through. [URL]
View 3 Replies
Apr 24, 2012
I have a project which is about creating interactive videos for users..The main idea is that user will open the app and a predefined video will show-up.Video will show couple of billboards, signs etc. while moving through a highway.. Like from a perspective of a driver..I need to insert users photos to these billboards and some text to signs..
The problem is, these objects which I'll be filling are changing their shapes constantly because of the car movement. I can get all the x,y coordinates and timings of the video from my partners. But I don't know how to use them in this situation.I think about continious tweens with these x,y values but I'm not sure..
View 5 Replies
Sep 23, 2011
I have an AS3 function that loads and audio file and then plays it. I have the pre-loader for the first audio file working - now I need to run the pre-load function before the 2nd audio file starts.
myMusic.addEventListener(ProgressEvent.PROGRESS, onLoadProgress2, false,0, true);
myMusic.addEventListener(Event.COMPLETE, playMusicNow, false, 0,true);
myMusic.load(soundFile, myContext); //This code works
[code].....
View 2 Replies
Feb 26, 2010
i'm trying to modify some code and can't figure out what the issue i'm having it. this is the(shortened) code:
public static function Lose():void {
trace("OVER!");
Clock.stop();[code]...
this is the error i get: 1180: Call to a possibly undefined method OverIt.i just want to call a function from inside of the public static funtion.both function are inside this class:
public class Game extends MovieClip {
}
View 4 Replies
May 12, 2004
Okay so I am reading through sens tutorial on OOP and updating my game that I am making. It is much easier to code this way (IMO) but still hitting snags.I am trying to get through this code:
[Code]...
View 3 Replies
Jul 24, 2011
I am currently making a game with Flash CS5 and AS3... namely Tetris I have created my main menu and the objects and so on and have a few questions
1) How do I quit the game should a player press the quit button?
2) How do I get a button (Z and X) to rotate an object whilst the object is moving downwards (it is moving downwards using the timer function)?
3) How do I get the object to stop once it reaches the bottom of the screen? (im thinking something along the line of the hit detect but havent had much luck)
4) Any ideas on how to get flash to detect if a line is complete and therefore delete it? (it needs to segment blocks off the graphic)
5) My final and most important question (the bit im working on at the minute) how do i get flash to call random functions so that random tetrominoes appear on screen so that the game is different everytime and the blocks are random as the player plays)
View 2 Replies
Apr 28, 2010
I do have an assignemnt, deadline os tommorow 4pm. In this assignment i should create interactive video in flash. I have choosen to create game like Mortal Kombat. I have one video with 28 cue points. I made buttons that take us to the right place in the video which are hidden at the beggining but are visable when video reaches first cue point. I have created life bar which in fact is made of 5 small MC`s and I thought that if user will press kick button then one small life bar will become hidden - I have no idea how to do this.
Second thing is that I want to put mp3 file but I want it to start at the same cue point as buttons.
third - I do want to dispaly random cue point of 2, so if user will press punch button he will be taken to piece where my character hits opponent or to the piece where opponent block the punch. And I want from time to time randomly display piece of the vide where my opponent hits the character[code]...
View 0 Replies
Mar 12, 2011
I want to make an Interactive Video in flash (or another method if known). basically to sum this up. I want to make a video which then some options will appear in the video (They could be buttons by the side of the video), which you then need to choose for another video to play. (Exactly like how you tube uses annotation) Is this possible with flash? or would I need to use another program?
View 2 Replies
Jul 28, 2011
I've a problem with calling the movieclip from the library with the if else case.If I take out the if else condition, the code runs normally but when I do I can't. I tried numerous attempts to fix the code but it still failed.What I wanted to do is, when I click one button out of 3 buttons at the 1st frame, it will pass the string (either red, blue or orange) to answer textbox. Then I store the string into a var called tarotno to go through a if else condition to call the MovieClip according to the string passed.[code]
View 1 Replies
Jun 16, 2007
I have this REALLY wierd problem. I have a MovieClip that is attached onto the stage. In this MovieClip I have the init() function. When I try and call this function, after the MovieClip has been attached on stage it doesn't work! I can't belive it!
MovieClip Frame 1
function init(){
trace("bleh");
[code].....
View 2 Replies
Apr 18, 2010
I have a series of movieclips stored in the .fla library
Clip1 (class: clip1)
Clip2 (class: clip2)
Clip3 (class: clip3)
Clip4 (class: clip4)
Clip5 (class: clip5)
I want to be able to add each clip to the stage using a function where the number is a variable that can be added to the "Add movieclip" statement.
For example:
var x:Number = 1;
var "Clip" + x:"clip"+x = new "clip" + x();
so that the program inteprets the above as:
var Clip1:clip1 = new clip1();
addChild(Clip1);
This was the only way I could think of adding a movieclip to a stage. I am open to any other option. I hope this was clear. I don't have any code to post because I'm just trying to work through the logic of the program. Adding movieclips to the stage when the name of the movieclip has a variable in it, is the part I am stuck on.
View 6 Replies
Feb 18, 2011
I'm trying to make an interactive video player where you have a choice of 3 buttons and each button links to a different frame that has a video player embedded in it. Once on of the frames are brought up, I have a button to take you back to the main screen. However, after clicking back to the main screen, I'm running into the following output error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at memorialsample_fla::MainTimeline/frame1()[memorialsample_fla.MainTime line::frame1:4]
at flash.display::MovieClip/gotoAndPlay()
at memorialsample_fla::MainTimeline/gotoMain2()[memorialsample_fla.MainT imeline::frame2:11]
Once the above output error occurs, the buttons are no longer active and no longer work. Here's a look at my code that I have going on:
Frame 1:
stop()//Link to Frame 2btn_MJ_Main.addEventListener(MouseEvent.CLICK, gotoMJ) function gotoMJ (e:MouseEvent){
//btn_Beach_Main.removeEventListener(MouseEvent.CLICK, gotoBeach)
//btn_MJ_Main.removeEventListener(MouseEvent.CLICK, gotoMJ)
btn_Cloud_Main.removeEventListener(MouseEvent.CLICK, gotoCloud)gotoAndPlay(2)
[Code] .....
If you want to see the actual SWF for a better visual at what I'm doing, you can see it here: [URL]. Scroll down to the Flash object, it says "Memorial Tribute Samples". I have the videos streaming, and am not sure how I could get the FLV videos to stop playing when I click the flash's "Return to Samples" button. Right now, the users would have to pause the video if they don't want it to play in the background as they go back to the first frame.
View 2 Replies
Jul 1, 2006
I've just downloaded Flash 9 Public Alpha and I'm trying some new stuff. I would like to change the scale of a MovieClip instance that I've physically created and dragged onto Stage but the compiler doesn't recognize the mc instance...Do I need to do something beyond just referencing the clip? : myMovieClip._yscale = 10;
I have a haunting feeling that AS3 will be too intimidating for me to even begin to try learning, I can't really grasp AS2 yet...
View 4 Replies
Dec 8, 2009
function test1():void
{
function test2():void {..}
[code].....
View 6 Replies