ActionScript 2.0 :: Mapping The Root To A Rectangle?
Sep 8, 2009
I have four points that make up a rectangle (note: the four points have the same aspect ratio as the window). The rectangle itself can be moved and scaled (again, keeps it's aspect ratio).
I want to map the root's positions (_x, _y, _xscale, _yscale) so that the box is always the frame of the window. This should be easy enough, except for the fact that the root's "hotspot" (position which it scales from) is always 0,0.
NOTE: I use four points to make the rectangle: xLeft, yTop and xRight, yBottom
come up with some code to change the root's _x, _y, _xscale, and _yscale to fit this rectangle
View 7 Replies
Similar Posts:
May 3, 2010
I have a class called shapeC that only creates a rectangle and then addChild(rectangle);. That class is instantiated on the main timeline. Currently, the only way you can see that rectangle is to add the instantiated class to the stage via addChild(shapeC);. My question is, is there a way that the shapeC class can add the rectangle to the root stage without requireing the instantiated class to be added to the stage?
View 4 Replies
Mar 8, 2010
For those of you still with me, I am tasked with making some scrollable content in Flash. Load in a TextFile using LoadURL(), then display it. To get the text, we've written our own class TextFieldExtended, which is basically just there to give the textfile location to the constructor and then have the class do the various steps of getting it and loading it for you.So I needed to get a Scrollbar, which I got hereThe thing is, it works with Sprites.After trying to get it to accept TextFieldExtended, I bumped into a block, since the scrollbar relied heavily on a Sprite property that TextFieldExtended didn't have or could have.
So I tried adding the TextFieldExtended instance to a Sprite instance using addchild.A problem occurs here that I do not know how to handle. It seems that a Rectangle is drawn and the Text is drawn on that. I say this because the scrollbar moves the Rectangle up and down a bit, but the text doesn't scroll, just the Rectangle it is positioned in and the text then moves along with it.My question: can this be fixed, or is does this implementation of scrollbars need a lot of adaptations before this is possible?
View 1 Replies
May 20, 2009
I draw a rectangle i should see a little bold circle to indicate a perfect rectangle, I seemed to lost mine, can somebody please tell me how to get it back!
View 2 Replies
Aug 2, 2011
I am trying to convert a rectangle(actually multiple rectangles) to a curved rectangle. I think it should be pretty easy but I guess i am stupid. Basically I would have a start position and stop position (many of these), and they would be converted to curved rectangles and follow in a cicrle around.
View 0 Replies
Jun 26, 2010
I would like to create a rectangle inside of a rectangle, starting approximately 15% inward from the right side of the other rectangle.
I know how to create rectangles with:
Code:
var newHotRect:MovieClip = new MovieClip();
newHotRect.graphics.beginFill(0x00FF00);
newHotRect.graphics.drawRect(0, 0, 100, 100);
addChild(newHotRect);
But how would I make another rectangle on top of that (the black one pictured) that is approximately 15% from the right?
I toyed around with .right, and .bottomright with no success. Can anyone lead me in the right direction? or even finding the x and y of the upper right or bottom right side of a rectangle?
View 10 Replies
May 20, 2011
how to respond when a rectangle hits another rectangle? I already know how to detect the collision, I just don't know how to respond to it. I'm just trying making a simple side-scrolling platform game where I have platforms I can walk on and bump against on all sides. I have searched everywhere and just can't find the tutorials I'm looking for.
View 6 Replies
Feb 3, 2009
[Code]...
Etiam nisi ligula, sodales non, pharetra eget, tempus ac, purus. Vivamus sagittis mollis risus. Proin dictum libero a elit. Curabitur feugiat, metus sit amet convallis imperdiet, est tortor volutpat nulla, eget mollis diam nisi vel lacus. In diam ligula, euismod eu, dapibus non, fermentum quis, urna. In consequat pede eget erat. Quisque luctus felis. Mauris dignissim. Fusce pulvinar, dolor sit amet porttitor egestas, quam massa tristique pede, nec porttitor diam odio in magna. Mauris congue mauris eu lectus. Duis eu felis ut ligula consectetur blandit.
[Code]...
View 1 Replies
Jun 23, 2009
I am using ZendAMF for remoting.
<?php
error_reporting(E_ALL | E_STRICT); //error reporting, not needed
require_once "Zend/Amf/Server.php"; //the zendAMF server
require_once "process.php"; //our test class
[Code]...
View 2 Replies
Jun 6, 2011
I'm building image processing or mapping system kinda like google map except we have our own HD images so i'm not sure what is the best way to do this in .NET here is what im trying to do Mapping web application build in .NET i've High resolution images , the user first load the selected area a full scaled image should be loaded 100% (original image) then he Zoom to the area he want, then he can move around this area almost like google map
1.user select area - full scaled image loaded
2.user zoom to random area - (i will receive some values for X, Y, etc.. in query string then i will extract these values and zoom/return the image based on these values)
So i'm not sure what is the ideal solution for this is it just zoom/re-size image based on the vales received from the user, or its more complicated than that?
View 1 Replies
Jul 21, 2010
i have an xml that i want to cast to a value object using the schema regitry class in flex..
so, i did sth like this :
Code:
var qname:QName = new QName(schema.targetNamespace.uri, "parameterTable");
schemaTypeRegistry.registerClass(qname, ParameterTable);
[Code]....
where the value is the xml value requested from the server using http method, i get a null value when i dbug the param content.
View 0 Replies
Aug 26, 2010
which is the best flash mapping api (with good support and reasonable price) to use in my flash project. I have used UMapper �s Umap before but it�s too expensive for a commercial license and the support was not that good.
View 0 Replies
Jan 14, 2009
Situation:
- We have a Flash application located on a SAP EP (let's say ep.x.com)
- We have a SAP ABAP Application (Webservices) on a SAP WebAS
server (abap.x.com)
- Clarification: This is not about Flash islands / but a normal Flash application communicating with WebAS ABAP via WebServices
Problem: Due to the changed security policy in Flash 10 this scenario does no longer work.
- A crossdomain policy file on root level cannot be deployed on root level
- The WebServices http/s headers cannot be modified, since the WebServices are generated by the WebAS IDE.
Comment: Technically there is a way to patch a WebAS ABAP,but this is not a practical / acceptable way in a normal SAP WebAS infrastructure.
Conclusion:- The above scenario (Flash from EP content / WebAS ABAP as backend) is a quite normal scenario in the SAP world.
- SAP / Adobe always features the close relationship between their technologies.
Question:- What could we do?
- How does the Visual Composer works around that problem?
View 1 Replies
Mar 22, 2010
I have a root stage, and a MC that is called from the root stage.Now from that MC, i will called in another MC2, and I wanted to placed the MC in the center of the stage. The reason I could not use normal ADDED_TO_STAGE at MC and define the center is because MC is not place in the exact position of the root stage (as in x, y=0). So if I would target MC2 at MC stage center, it would not be the exact center of the root stage/screen.How can I called the root stage properties rather than adding MC2 into the stage?
View 1 Replies
Nov 7, 2011
How do you tell the root timeline to root.gotoAndStop(2); from the timeline of a movieClip added using addChild?In the maintime line I have
addChild(fade_eng);
and in fade_eng I have the following on frame 20
root.gotoAndStop(2);
this.gotoAndStop(1);
But I am getting 1061: Call to a possibly undefined method gotoAndStop through a reference with static type flash.display:Stage.
View 1 Replies
Oct 13, 2009
I'm new to flash and working to embed the flash player in a .NET application. It's going "well" for the definition of "well" that adding the COM control and getting it to play a movie was easy and took about 3 minutes.What's not going well is that I cannot find documentation on the variable to string mapping used the SetParameter variable parameter. To coordinate between the apps, I want to be able to say: "flashPlayer.SetVariable("flash_variable", "value_to_set"). Obviously SetVariable does this. What's not obvious is how "flash_variable" is constructed.
For example, in the actionscript for a button called "OneBigButton" I have the following code:
OneBigButton.addEventListener( MouseEvent.CLICK, onClick );var testSetValue = "value";function onClick(evt:MouseEvent):void { trace("got the click " + testSetValue); outputText.text = testSetValue;}
When I try this:
flashPlayer.SetVariable( "testSetValue", "foo" );
The results do not get set in testSetValue.
I'd love a pointer to the documentation on how namespaces, class instances, etc affect the string construction used in SetVariable and GetVariable as I can't find it anywhere.
View 3 Replies
Jun 26, 2009
When I login a new session is generated. How can I later know for which login the session was generated? I am getting the session value, but how do I know which user the session is for and redirect him to that page?
View 1 Replies
Oct 28, 2011
I am building an application using Flex 4.5 and Zend_AMF as my AMF endpoint.I would like to map a class called CRequest in PHP to a class called Request in Flex.This is my php class:
<?php
namespace appweb;
class CRequest{
[code].....
View 2 Replies
Sep 29, 2009
Dear goodness, am I the only person on the web trying to send a VO object from Flash to AMF where the properties are read only/getters? If I add a setter that does nothing but throws an Error it works. If no setting is present in Flash, it fails. Is there a way to send objects to AMF that have getters and not setters?
View 3 Replies
Jan 22, 2010
The way my test works, I draw a path on a displacement map using the mouse, and this displacement is applied to the same image every frame (i.e., the displaced image of the last frame is displaced again). Colors are flowing along the path as they should, with one problem: the displaced pixels always turn transparent after a few seconds.At first I thought this had something to do with the DisplacementMapFilterMode, so I tried setting it to "COLOR" using an opaque bright blue, while the stage behind my warped image is a highlighter green. Nope, the FilterMode color is only used for pixels sampled off the image, while my interior pixels were turning completely transparent of their own accord. I tried removing the alpha channel from my distorted image, and then the pixels would just turn black instead of transparent.
So, now I'm stumped. I've viewed my displacement map to make sure it looks right, I've tried setting the displacement scale to low and high numbers, and I've checked the channel assignments, all to no avail. Here's my code, and I've attached the .fla as well, so you can see what's happening. If you run the file, just make your mouse is located in the center of the frame before it starts, or you'll end up dragging the blue fill color in from off the screen.
Code:
// "spider" is the name of a named movie clip instance containing
// an image on the stage, having the same dimensions as the stage
[code]......
View 0 Replies
Jan 17, 2011
I'm still having trouble mapping my as3 class to a server side class in C#. I've been through several tutorials and the official documentation butI must be doing somethiing wrong. I found that I have to use an attribute in my as3 class: [RemoteClass(alias = "FlashRemotingExample.WorkerCS")] But that is still not working.
View 1 Replies
Sep 12, 2011
if it is poosible image mapping in flash like in html <maparea>? is yes means how to do that in flash?
View 2 Replies
Jan 24, 2007
I've done a bit of web design work,and have used Flash a little,so familiar with the principles of the timeline, keyframing, and twining etc.The sort of thing we might be looking to produce would be similar to this site below :[url].....how technically challenging that might get,or is it the sort of thing that although looks complex, might be relatively easy to achieve armed with a reasonable understanding of the Flash principles that are driving it.
View 10 Replies
Sep 29, 2009
I am have about 80% of a my website built and buttons all mapping where they should go, along with a number of XML driven BANNER ROTATORS/ACCORDIAN MENUS...ect
This site requires users to be signed in, which is done through a site previous to mine. Once they log in, they can click a button which then allows them access to my site.
My site has three "user levels" or "autentication levels" as we have "Managers", "Supervisors" and "Staff" levels.
For testing purposes, we have placed the below actionscript in the first frame of my project. The purpose of this actionscipt is to reference the "authentication level" that the user is using (as they will have already signed in so we are simply looking to obtain their "auth level").
[Code]...
View 3 Replies
Oct 6, 2011
I'm using this tutorial to create buttons with displacement mapping for my simple game menu. These buttons need to be clickable; i.e. once you click on them you move to a different frame. Everything works fine on the first frame, but when I click to the next frame the displacement map disappears and will not apply to the buttons on that frame. Plus, when I click my "back" button to return to Frame 1, the displacement effect has disappeared entirely.
This is the code which is in the base "Game" class, which links to the main Flash file.
package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;
[Code]....
It calls the JitteryButton class, another external class, which I don't think is the problem, but I can post if if necessary. It's very similar to the one in the tutorial. Also, I need to add different buttons on other frames of the menu, but if I call them in this external class, it doesn't recognise them.
can anyone spot why this might stop working like it does? I was thinking about instead of using "Game" as an external Actionscript file, I could actually write it into Flash as Actionscript on a layer - would this work?
View 1 Replies
Jun 16, 2009
If I've got a bunch of plain old Objects, what's the best way to map them to a bunch of Classes?For example, if I use an HTTPService to pull in some JSON, then deserialize it, I'll have a bunch of objects which look like:
{ type: "person",
id: 42,
name: "David" }
And I want to turn them into instances of a Person class:
class Person {
id:int;
name:String;
}
(also to be considered: how about some standard way of dealing with relationships between objects? For example, if the Person had an additional "spouse" field:
{ type: "person", spouse: 61, ... } // Where 61 is the ID of the spouse
)
View 2 Replies
Sep 23, 2009
I'm working on a website using :
- Flex 3.4
- AMFPHP 1.9b
- Propel 1.3
- PHP/MySQL
I'll try to focus on the problem which takes place in a whole system.To sum up, I have 2 entities (MySQL) :
create table AAA
(
id_AAA int not null auto_increment,
id_BBB int,
[code]....
I retrieve all my BBB, they are mapped from PHP classes (generated by Propel) to AS3 classes on the Flex side.But when I create a AAA row in the database.I retrieve all my BBB, and all objects are mapped EXCEPT the BBB whose id corresponds to the foreign key in the inserted AAA row.
if you know anything about how AMFPHP / Propel / Flex are dealing with Foreign Keys and why class mapping is failing right here.The weird thing is that it seems to happen only for this specific case ...
View 2 Replies
Dec 1, 2009
I have an issue when consuming a web service from a Flex app. In the backend I have a hierarchy, let's say I have an abstract class Fruit, and 2 implementations: Apple and Orange. Fruit has a property, name, Apple has a property color, and Orange has a property radius. Then, I have a service wich returns a collection of Fruit. When I consume it from Flex, this collection returns objects wich type are Fruit, with its name property; but I lose all the properties for the implementation classes (color nor radius). So, the question is, does Flex support inheritance mapping when using web services? If not, is there any workarround?
View 1 Replies
May 14, 2010
i am developing an application where client can add his photos to appear on a sphere or ball or coffee cup and able to save them and give it for printing using flex. like itasveer.com site. i tried to use away3D but if the image is small it is stretched and added to sphere. i dont want it to strech instead the original image shud appear on the sphere. if it is added to cup it shud cover only the circular part it shud not add this to top and bottom.
View 1 Replies
Mar 25, 2011
I have 2 java classes that are the same (imagine the getters and setters):
class ScheduledEvent {
private String eventName;
private List<eventValues> values; [code]....
Now there is a reason why there are two classes that are the same.When something is "scheduled", I should get the ScheduleEvent object and when an event is started, I should get the StartEvent object.And depending on the object I get back, I do different things.My problem is that, on the backend, it will send me the ScheduleEvent object, but once it got to the flex side (via BlazeDS), it becomes a StartEvent....
At first, I thought it's because these two events have exactly the same variables, so I tried changing ScheduledEvent by adding a dummy variable (String foobar) but that didn't seem to make a difference.
EDIT: I'm using BlazeDS messaging system.That's why I am not using "one java method call to one responder" approach. So, in the message.body, I should be getting ScheduledEvent but I keep receiving StartEvent. I'm wondering if it's because the two objects have the same property and BlazeDS doesn't know how to map them correctly... I even put a break point in the java service layer, to make sure that the appropriate object is being sent back and it is... But by the time BlazeDS serializes and deserializes it to the flex side, it is now a StartEvent.
View 1 Replies