ActionScript 2.0 :: ANOTHER Image Resize - Put The 'this.onEnterFrame' Section Just Before The ResizePic Function Is Called

Mar 2, 2006

I've followed the tuts on the site and written||cut'n'paste a few bits together that resize my picture to the border's size.

[Code]...

First; this code didn't work properly until I put the 'this.onEnterFrame' section just before the resizePic function is called. Why? Second; I've noticed a lot of times 'onEnterFrame' is called, its deleted again further down the code. Should I be doing so in this case? Why is it normally deleted? Memory managent?

View 2 Replies


Similar Posts:


ActionScript 2.0 :: [FMX] OnEnterFrame Calling Function That Shouldn't Be Called

May 16, 2004

I'm making a game, and it has an onEnterFrame which checks each players status (hp and turn), and decides what to do based on that. Looks like this:

Code:
_root.onEnterFrame = function(){
if(enemy.HP>0){
if(hero.HP>0){
if(hero.turn==0) {

[code]....

So this works fine when it's the players turn. But when it's the enemy's turn, the enemy simply attacks a bunch till hero.HP<0 and enemy wins. I am certain this is because it's checking each frame to see if it's the enemies turn and then it executes the hitting code before the turn is changed (which must mean this is freakin fast, so cool, but not good for me here!).I tried simply making a function to call at the end of the attack, with a function that happens only on first turn to let the player initiate, but when then the hero makes no attack, enemy attacks and there is a recursion error and it shuts down.

View 5 Replies

ActionScript 2.0 :: OnEnterFrame Calling Function That Shouldn't Be Called

May 16, 2004

I'm making a game, and it has an onEnterFrame which checks each players status (hp and turn), and decides what to do based on that.[code]So this works fine when it's the players turn. But when it's the enemy's turn, the enemy simply attacks a bunch till hero.HP<0 and enemy wins. I am certain this is because it's checking each frame to see if it's the enemies turn and then it executes the hitting code before the turn is changed (which must mean this is freakin fast, so cool, but not good for me here!).I tried simply making a function to call at the end of the attack, with a function that happens only on first turn to let the player initiate, but when then the hero makes no attack, enemy attacks and there is a recursion error and it shuts down.

View 5 Replies

ActionScript 2.0 :: Resize Image Function?

May 15, 2009

Can any one know a function that is doing resize and it is doing it right, because I have made a function but it I make my image small like 70x50 from 950x500 it is distorting it.

View 9 Replies

ActionScript 2.0 :: OnEnterFrame=null - OnEnterFrame=undefined & Delete OnEnterFrame

Mar 29, 2008

onEnterFrame=null, onEnterFrame=undefined & delete onEnterFrame....

Which one to use??? What are the performance considerations. If all my movieclips on-stage are running a MovieClip.prototype.onEnterFrame = function() {run initial stuff before setting onEnterFrame=null/undefined... }, will there be performance hits? It's sad that delete onEnterFrame doesn't work unless I delete the prototype enterFrame as well, which would make the clips reinitailise itself again once you declare the enterFrame prototype again (i need to do this since there's more movieclips that end up appearing on-stage, and they need to automatically initialises themselves the moment they appear).

[Code]...

View 5 Replies

ActionScript 3.0 :: Scale Or Resize The Image By Dragging And Resize Option?

Sep 19, 2011

I am working on image and i like to scale or resize the image by dragging and resize option.same working as "free transform tool" in flash (design part); i need same functionality in application.

View 7 Replies

Wordpress Based Site That Stores Information About An Image In A Database Field Called "background" In A Table Called "wp_postmeta"?

Jul 22, 2009

I have a wordpress based site that stores information about an image in a database field called "background" in a table called "wp_postmeta".The 'loader' gets an url such as "/thisImage/background.swf"The "background.swf" should somehow display "background.jpg" instead but since I've changed the field name in the database (from background to temp_background) it doesn't work.I pass variables to the "loader" swf and they are correct based on the new field name but it still isn't working.I need to know if there is anything in the .fla's (and therefore the .swfs) that is pointing to somewhere in the database hard-coded. Basically I need someone to look at them and tell me how they are working.

View 2 Replies

ActionScript 3.0 :: Compiler Bug - Var Declaration Function Definition Postcedes External Called Function Execution

Jun 29, 2010

Use Flash CS5 (and AIR, though this does not seem like it would be AIR related) in Win XP 64 I have a MovieClip symbol in my library with the identifier 'Puzzle10Piece10' with the following actionscript attached to frame 1 of the only layer with the following actionscript:

[Code]...

This runs contrary to my understanding of the pre-compiler and code execution order. In my way of thinking, any reference creation and related memory allocation is made when the object is instantiated, and indeed that allocation, unlike C depends not on code order (declaration before use), though this is an order that would satisfy even the C pre-compiler. If I understand the Flash compiler at all, it's not even a question of 'code order'... the symbol is pre-compiled such that for it to exist... for it to be instantiated, the variable would exist before the function would even be 'available' to be called internally or externally. Is my thinking way off, or is this a bug?

View 6 Replies

ActionScript :: Flex - An Object Returned From A Function Call Changed The Next Time The Same Function Is Called?

Jan 10, 2012

I have an AS3 program that calls a function multiple times. The function must return multiple variables, so I created a class for the function to declare an object containing all of these variables. For example, here's my class:

package
{
public class PER
{
[Code].....

Let's say the calling program calls the function, which returns the variables into data_set1 (where data_set1 depends on input variables arg1, arg2, arg3) using:

var data_set1:PER = function_name(arg1, arg2, arg3);

The calling program does some stuff, then calls the function again, but returns the variables into a new variable name, data_set2:

var data_set2:PER = function_name(arg4, arg5, arg6);

My intention is that data_set1 and data_set2 are different (e.g. not linked together).

My question is, given that arrays are passed by reference, will data_set1 be modified to agree with data_set2 upon the 2nd function call? Why or why not?

View 1 Replies

ActionScript 2.0 :: Play A Section On The Timeline And Then Move Onto Another Section Or Scene

Mar 9, 2009

I have a button that I would like to use with the basic actionscript as follows:

on (release) {
this.gotoAndPlay("15");
}

What I would like it to do is play a section on the timeline and then move onto another section or scene.

[Code]....

I know this is incorrect, so would anyone know how to write an actionscript button that plays a section then goes somewhere else?

View 4 Replies

ActionScript 2.0 :: OnLoad Function Not Running Within Section SWF

Feb 9, 2004

I have 2 swf's:
Section.swf (to be loaded in main)
Main.swf

In section.swf, on the first frame I have this:
[AS]
onLoad = function(){
// start doing stuff
}[/AS]

When I run the section.swf on its own, the onload function works, and the "doing stuff" code runs. But when I load it into main, this onload (within the section.swf, above) does not run!

View 7 Replies

ActionScript 3.0 :: Return Result From Function Called By Function?

Aug 4, 2010

I'm using an AMF service that was built by someone else. Basically what happens is that some info is passed to the AMF service and it returns true or false.I want to be able to pass in various info to the a function that calls the AMF service(submitTracking) and then get the true or false value returned in onResultSubmit to be passed back to submitTracking.

var screen:String;
var buttonnumber:String;
function submitTracking(screen:String, buttonnumber:String) {

[code]....

View 3 Replies

Professional :: How To Use This.onEnterFrame = Function()

Jan 10, 2010

as2 this works but in as3 it no work how do you do this in as3
 
this.onEnterFrame = function() { if(Key.isDown(Key.UP)) {  square._y -= speed; }

View 4 Replies

ActionScript 2.0 :: Variable From OnEnterFrame Function?

Feb 19, 2009

I need to get the width of mc and pass it to a global variable that i can use.

Heres the code sample.

ActionScript Code:
xCor = -3;// this value is actually in the xml so it depends whether its negative or positve
var dragitem:MovieClip = _root.createEmptyMovieClip("new_item"+dragItemTracker,

[Code]....

View 3 Replies

ActionScript 2.0 :: OnEnterFrame Function Not Working?

Nov 2, 2009

I'm not getting errors but my program wont call my function.

Code:
this.onEnterFrame = function() {
if(wm == 10)[code].....

I want to change to my end game screen when my value of variable wm gets to 10. Sorry I cant figure out whats wrong with the if statement. It doesnt work outside a function either.

View 1 Replies

ActionScript 2.0 :: Call Function Within A OnEnterFrame?

Dec 3, 2005

i want to call a funtion once within a onEnterFrame, butthe problem is that the onEnterFrame needs to go on and execute the function only once...(if its between the desired x positions (see script below))

my code

Code:
onClipEvent(enterFrame)
{
if(this._x < -150 && this._x > -1600)

[Code].....

View 1 Replies

ActionScript 2.0 :: Make A Function Go On Without An OnEnterFrame?

Mar 13, 2006

How can I make a function go on without an onEnterFrame?

View 3 Replies

ActionScript 2.0 :: Replaying An OnEnterFrame Function?

Feb 7, 2007

Got a piece of code that moves a line of text I'm calling "eeScroller". I'm using this method because timeline and as tweens make the movement herky jerky (when the movement is slow).

What I want to do is reset the _x of eeScroller to 0.9 once it reaches the _x of -889.3

Here's what I got so far:

Code:
function movething() {
_root.eeScroller.onEnterFrame = function() {
if (_root.eeScroller._x>=-889.3) {

[Code].....

how to implement onMotionFinished if that's even the way to do it...

View 1 Replies

ActionScript 2.0 :: Executing A Function In OnEnterFrame?

Jul 17, 2003

A function has to "run"(execute) inside the onEnterFrame event method but the function does not seem to run when called.

Example:

_root.onEnterFrame()=function(){
if(something==true){
performFunction();

[Code]....

View 3 Replies

ActionScript 2.0 :: Call The Function With OnEnterFrame?

May 29, 2009

cerbatana is the instance of my button.. I need that when I hold left key... the "moverizq" function starts.. so I create a new function.. where I have the condition for Key.is Down and then I call the function with onEnterFrame..

function moverizq() {
cerbatana._x = cerbatana._x-5;
}
function moverder() {

[Code]....

View 1 Replies

IDE :: Use An OnEnterFrame Event To Call A Function Just Once?

Oct 5, 2009

I need to use an onEnterFrame event to call a function just once. Here's the code:

my_object.onEnterFrame = function() {
if (this._y == 100) {
my_function();
}
};

So say i drag "my_object" to a y-coordinate of 100, how do i make it so it only calls the function once. Then if i drag the object away from y=100, and then back to y=100, i want it to call the function again.

I'm using the onEnterFrame event b/c i need it to constantly look for the object to be at y=100, maybe except when its actually at 100.

View 4 Replies

ActionScript 2.0 :: Call Function Only Once In OnEnterFrame

Nov 4, 2010

I've been trying to work this out.
Code:
function ghostGoUpDown(currentGhost) {
//do stuff
} benet.onEnterFrame = function() {
//do stuff
if(maze_mc.hitTest(this._x-16,this._y,true)) {
[Code].....
How can I change it so that the ghostGoUpDown is only run once each frame the hit test is true?

View 4 Replies

ActionScript 2.0 :: Stop An OnEnterFrame Function?

Mar 6, 2005

How can one stop an onEnterFrame function?

View 5 Replies

ActionScript 2.0 :: OnEnterFrame From A Prototype Function?

Aug 30, 2004

The function is called on release of a movieclip. I'm making a drag a drop navigation and there are two content windows .. "h1" and "h3".

I don't think there's anything(much) wrong with my code itself, I'm just having trouble with calling anything within h_ins.onEnterFrame. Is there a fundamental issue that I'm not aware of? Below are all the details if you're interested.

[Code]....

View 1 Replies

ActionScript 3.0 :: Using The AddChild Function To A Movieclip To Load Up Another Section On The Site?

Apr 24, 2011

I'm using the addChild function to a movieclip to load up another section on the site. However,everything behind that loaded SWF is still running,meaning sections are constantly stacking and it slows down the more sections you access.I've been trying to think of ways to resolve this and have yet to come up with a decent solution. I've thought of removing the previous swf,but that would would take the swf with it that was loaded as a child.Here's the important bit of my code you should see:

ActionScript Code:var section2Request:URLRequest = new URLRequest("Tracks.swf");var section2Loader:Loader = new Loader ();tracks_mc.addEventListener(MouseEvent.CLICK, tracksPage);function tracksPage(event:MouseEvent):void{[code]......

View 1 Replies

ActionScript 2.0 :: Loading Image With OnEnterFrame

Jan 21, 2010

I'm trying to get images from a folder and show them on screen using a movieclipLoader and onEnterFrame.My images are called greaudstudiodiapo_ 1. jpg, greaudstudiodiapo_2.jpg, and so on.So I was trying to increment i of one evrytime a picture is loaded but it is not workin tough the trace of "i" of "showpict" and of (clip_image_mc) seems to be ok. here is my code.[code]

View 9 Replies

ActionScript 2.0 :: Loading Image With OnEnterFrame?

Mar 17, 2010

I'm trying to get images from a folder and show them on screen using a movieclipLoader and onEnterFrame .My images are called greaudstudiodiapo_1.jpg, greaudstudiodiapo_2.jpg, and so on.So I was trying to increment i of one evrytime a picture is loaded but it is not workin tough the trace of "i" of "showpict" and of (clip_image_mc) seems to be ok. here is my code .

ActionScript Code:
_global.i=1
function showpict (pictureNumber)
{

[code]....

View 2 Replies

ActionScript 2.0 :: What Is The Word 'section' In _root.section

Dec 17, 2003

on [URL] what is the word 'section' in _root.section? I assume it is a movie clip instance, but can't seem to find it on the timeline.

View 2 Replies

Flex :: Build A FormItem With An Image Button In The Label Section?

Jul 30, 2010

I want to build a flex FormItem extension that adds a button into the item label section, such that there is both a text label and, to the right of it, a button that uses an image icon: Basically, I want to create that 'i' icon, such that I can click on it to display a help overlay for the item in question.Is there an existing component that does this? If not, how do I do it?

View 1 Replies

ActionScript 2.0 :: Putting A Function On An OnEnterframe Funct

May 1, 2009

Just wondering what the effects are of putting a function on an onEnterFrame function.

when you call the function what will it do differently? if anything. And is it a bad thing? will it cause bugs?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved